Error with nginx reverse proxy setup

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error with nginx reverse proxy setup

nginx mailing list
Hi All,

I am setting my first reverse proxy by following online posts. The problem is that when I type the http://my_ip_address/my_rev and it returns an 404 error:

Not Found

The requested URL was not found on the server.
If you entered the URL manually please check your spelling and try again.

Here is what I did:

1. installed nginx 1.10.0 on ubuntu 16.04
2. created file my_nx.conf under /etc/sites-available with following:

    server {
            listen 80;
            server_name my_ip_address;  

            location /my_rev {
                    proxy_pass http://192.168.1.65:5000;
                    include /etc/nginx/proxy_params;
            }
    }
3. Under /etc/sites-enabled, a symlink my_nx.conf was generated pointing to /etc/sites-available/my_nx.conf
4. restart nginx
5. On browser, type http://my_ip_address/my_rev and, the error

The configuration seems very straightforward. Where have I missed? Many thanks.

-Jun C






_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error with nginx reverse proxy setup

Anoop Alias
Are you sure you don't have a default vhost?

Try adding a server name and input the server name in browser so you are sure you are hitting the correct server {} in the config.
Or if you want to use IP ensure the vhost you add is the default.

On 19-Mar-2017 8:35 AM, "Jun Chen via nginx" <[hidden email]> wrote:
Hi All,

I am setting my first reverse proxy by following online posts. The problem is that when I type the http://my_ip_address/my_rev and it returns an 404 error:

Not Found

The requested URL was not found on the server.
If you entered the URL manually please check your spelling and try again.

Here is what I did:

1. installed nginx 1.10.0 on ubuntu 16.04
2. created file my_nx.conf under /etc/sites-available with following:

    server {
            listen 80;
            server_name my_ip_address;  

            location /my_rev {
                    proxy_pass http://192.168.1.65:5000;
                    include /etc/nginx/proxy_params;
            }
    }
3. Under /etc/sites-enabled, a symlink my_nx.conf was generated pointing to /etc/sites-available/my_nx.conf
4. restart nginx
5. On browser, type http://my_ip_address/my_rev and, the error

The configuration seems very straightforward. Where have I missed? Many thanks.

-Jun C






_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Loading...