How to avoid 404 and proxy properly with ngnix to an application with apache at /var/www/html?

So basically I want to use my server to code with cloud9 and at the same time test my website in apache on port 8080
I am trying to get this work but it doesn't. I get 404 error.

server {
listen 80;
server_name _;


location / {
#CLOUD9
proxy_pass http:127.0.01:8181;
}

location /phpapp/ {
proxy_pass http:127.0.01:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}


}

Comments

  • One more thing I want to use cloud9 because vultr 2.5 dollars is really slow to code with vim.
  • @mota57 You have missed out the "//" and a "." between the 01.

    My guess is that nginx is thus treating the link as a local filename specification.
    You want:

    proxy_pass http://127.0.0.1:8080/;
Sign In or Register to comment.