So I have this node website which need to be redirected to port 3000 of localhost. I've looked through many threads and everything I do, results in failure. The only thing that is working, is when I change the documentRoot of the website. I've confirmed this by making a html page and it works. This is what is recommended for the site to work but I don't know how to apply it to ISPconfig. Code: server { server_name example.com; # Change domain to your domain location / { proxy_pass http://localhost:3000; # Change ONLY the port if needed. proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Real-IP $remote_addr; } } What I have right now in the nginx directives is Code: root /home/faxcad/ I also have enable proxy checked as you can see in the image below. Thanks for the help in advance!
Disable the PROXY protocol as you are not using it, and you then put the needed directives in the nginx Directives field; try just the location directive, as your custom directives should be put inside a server {} block, and the server name set already. If that doesn't work right away, search the forums for similar posts, as others have posted working directives in the past.
I've tried that already I still get an error 500, As soon as I put in a index.html file then the error 500 disappears. These are my current Directives Code: server { root /home/faxcad/ location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Real-IP $remote_addr; } } I also thought that I didn't have to put the server block in as the directives get added between those blocks anyways not sure if its good to have more than 1 server block
No, you shouldn't. I am also not convinced that that directives are working but you should already knew that when you run them. Search "site:howtoforge.com nginx directives delete" and see various examples on overriding via directives if you do not have the ISPConfig Manual.
All I can see is that you want proxy config and root path to be changed accordingly to your needs so you were right on checking proxy. However you need to change the default ISPConfig proxy config and as well root path, so overriding them becomes necessary and that is what you must search. So first, see the vhost created by ISPConfig when you ticked proxy then do the necessary overrides based on your research.
Nevermind, got it to work, just don't know why it started working when I tried this earlier Code: ##delete## root {DOCROOT}; ##merge## root /home/faxcad/; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Real-IP $remote_addr; }