user4739287
user4739287

Reputation:

Nginx reverse proxy on python simplehttpserver

I was trying to setup NGINX reverse proxy on Python SimpleHTTPServer. My web.conf file present in /etc/nginx/conf.d and the setting present in the file is as follows.

server {
    server_name localhost;

    location / {
        proxy_pass http://192.168.1.3:8000/;
    } 
}

My NGINX is up and running. I did the reload after saving the web.conf file. On the other hand, I'm also running Python SimpleHTTPServer in directory home/user/projects/

But when I open the browser and visit localhost it shows me the NGINX Welcome Page and not the index.html file which is inside the directory in which I'm running Python SimpleHTTPServer.

Upvotes: 1

Views: 5740

Answers (1)

Wissam Youssef
Wissam Youssef

Reputation: 830

Two things:

1- you forgot in your configuration file to specify the listening port just add :

listen 80;

2- the default configuration is still active check if there is symlink called default in:

/etc/nginx/sites-enabled/

and delete it 3- Preferably add your settings file in

/etc/nginx/sites-available/

then make a symlink to it in sites-enabled , that way you can just delete the symlink if you want to deactivate the site instead of removing the configuration . instead of putting it in conf.d.

check how to configure nginx for more details

Upvotes: 1

Related Questions