Hot answers tagged

50

For me the directory was in the correct context, only it was included in the (hidden) .dockerignore file in the root of the project. This leads to the error message: lstat mydir/myfile.ext: no such file or directory


49

From the documentation : The <src> path must be inside the context of the build; you cannot COPY ../something /something, because the first step of a docker build is to send the context directory (and subdirectories) to the docker daemon. When you use /srv/visitor you are using an absolute path outside of the build context even if it's actually the ...


45

You would need to use a reverse proxy to do this, e.g. Apache 2.4. with mod_proxy_wstunnel. Use it as a frontend and then tunnel the connections to the appropriate backend.


40

Use Rewrite conditions to match for this special case: RewriteEngine On RewriteCond %{REQUEST_URI} ^/socket.io [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /(.*) ws://localhost:8082/$1 [P,L] ProxyPass /socket.io http://localhost:8082/socket.io ProxyPassReverse /socket.io http://localhost:8082/socket....


29

From my understanding, it seems that you only use one local dev machine, means not connected to any network that provides a DNS. If i am right, i would suggest to setup things like described below : step 1 : Assign at least two IP address to your MAC OS (one per domain), let's say : 192.168.0.10 192.168.0.11 To setup the second IP you will have to add a ...


28

You express configured to serve path /index.html, but you requires /test-express/index.html. Either configure express to serve /test-express/index.html or make nginx to strip /test-exress from proxied request. Latter is as simple as add trailing slashes to location and proxy_pass. location /test-express/ { proxy_pass http://127.0.0.1:3002/; } See http:...


24

By default SELinux only allows the web server to make outbound connections to a limited set of ports. # semanage port --list http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000 To fix the problem, you simply need to add your own desired port number to the list. # semanage port --add --type http_port_t --proto tcp 7777 Then ...


22

Only a single process can listen on a particular port for the same IP address and protocol, because otherwise operating system wouldn't know which process to send the received packet to. To achieve what you want you will have to use a reverse proxy which will listen on port 80 and forward traffic to correct destination. There are multiple ways to do this. ...


22

There are a lot of things you could be doing to improve your deployment process. A few of them are: Ensure your code is well tested. Ideally you should have 100% unit test coverage, as well as integration testing for every conceivable scenario. If you haven't got this, you should probably drop everything and get this taken care of. Look into behavior-...


16

Try adding this to your nginx.conf in the http {}: user www-data; worker_processes auto; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { # this section is needed to proxy web-socket connections map $http_upgrade $connection_upgrade { ...


16

You use the container's name as you defined it in docker-compose.yml. Docker provides the IP addresses for the named containers via DNS within each container, and updates them if the containers are updated. In this case, you called it server, so that is what you would use. proxy_pass http://server:8000; Documentation: Networking in Compose


14

Try from another terminal killall node Works in OS X and Linux. It may also prevent respawning node processes. For instance if a node some_server.js is running it may that any normal kill command (even kill -9 <PID_of_that_process> will simply result in a respawn node some_server.js process with a different PID. In that situation the only way to kill ...


14

in order to avoid this error, you can resolve the non-symlink executable with which node, as full example: sudo apt-get install libcap2-bin sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\`` the "which" command shows the full path of shell commands.


13

I just re-checked this. Both nodejs and npm and all dependencies for both have been added to epel 7. I just installed both on my CentOS 7 box. You should be able to do: yum -y install nodejs npm The -y flag will automatically answer "yes" to every confirmation question, so leave it out if you want to be able to say no to something.


12

It's stored in the Windows certificate store. When you import the signed certificate, you will find you have a corresponding private key. It matches them by modulus, if I recall. You can get a list of the private keys you have as a result of certificate enrollment requests (such as you made with certreq) by running certmgr.msc for the computer account (or ...


10

I've just come across this problem too. I found that a postinstall script would not run but a prestart would. Mine looks like this: "scripts": { "start": "node index.js", "prestart": "node node_modules/webpack/bin/webpack.js" } That now correctly bundles my webpack stuff before starting the server when I run eb deploy locally.


9

I know this question is super old, but I just ran into the same issue. Make sure the user you are running nginx as has write privileges to the proxy_temp directory. If you are serving a larger response through your proxy server that can't all be held in your proxy_buffers, the rest of the response data gets written to disk in your proxy_temp directory. If it ...


9

On Centos 7, for installation of npm and nodejs, follow these steps 1. Open terminal 2. Run these commands (With sudo or root) yum install epel-release yum install npm nodejs


9

They added the file.exists() method. const fileExists = _=>{ return file.exists().then((data)=>{ console.log(data[0]); }); } fileExists(); //logs a boolean to the console; //true if the file exists; //false if the file doesn't exist.


8

NPM isn't packaged for EPEL 7 yet. Give it some time, they are having to update thousands of packages already and had to wait for the CentOS release which was just a couple of days ago. I suggest contacting the package maintainer (who appears to be patches) as they may not be aware that CentOS 7 is released and that they can now build their packages for it.


8

curl -L https://npmjs.org/install.sh | sh I found this here: https://www.npmjs.org/doc/README.html#fancy-install-unix- I tried it on a fresh CentOS 7 install and it works!


8

For me the issue was that I was using docker build - < Dockerfile From the documentation Note: If you build using STDIN (docker build - < somefile), there is no build context, so COPY can’t be used.


7

The answers above are outdated AS ROOT curl -sL https://rpm.nodesource.com/setup | bash - yum install -y nodejs and you are done. verify your install with node -v


7

This looks like it might be just be an automated scan, so there is a lot in play here behind these. So I'm going to focus on your first question: How did the hacker even manage to send a GET request to my server such that "http://www.google.com" shows up in the log while my server is simply an API that works on relative URLs such as "/api/login". Web ...


7

As the error message says, this is a Permissions issue. This is usually caused by nginx process user (www-data for example) not have read/execute access to one of the parent directories. Check through /var/lib/nginx/client_body/ and make sure the permission is correct at each directory level to solve the problem.


7

Solution is npm install --no-optional


6

After PREROUTING local packets go to the local filter where they get dropped (your case 2). So you just need to allow incoming traffic to those ports in iptables: iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 3000 -j ACCEPT Since you are redirecting http(s) traffic from 80/443 to 8080/3000 is like the ...


6

Ghost runs a single node process per instance. I believe what you're seeing there is that htop shows the underlying threads of processes, so it looks like you have one Ghost instance running but node/v8 has five active threads. Despite JavaScript being single-threaded, the engine/vm itself can be multi-threaded. We (the Ghost project) do pay attention to ...


6

Here is the response from heroku. Looks like you need to make configuration changes and can't use the out of the box config. Hi Stan, Thanks for linking to those docs; I'll need to update that terminal example as I've recently silenced the chatty WEB_CONCURRENCY output. We added logging when we added the feature largely so folks wouldn't be surprised at ...


6

It seems from what you say that you have a maintenance window from 1 am to 7 am every day the issue is not time but convenience. This is normal and many people just deal with it as part of business. You could have a 2 (or more backend) systems with a front end that directs traffic to whichever is currently live. Once you are happy that a release is going to ...


Only top voted, non community-wiki answers of a minimum length are eligible