python - Configure Nginx to serve one endpoint only -


i using flask.

i have site configured in nginx @ www.example.com/.

now requirement serve one of endpoint in app using different domain www.example2.com.

so can accessed www.example2.com/custom

note want use www.example2.com domain name endpoint. possible in nginx?

here nginx configuration reference.

# upstream component nginx needs connect upstream flask {     server unix:///home/ubuntu/opt/app/mobifly.sock fail_timeout=0; # file socket }  # configuration of server server {     server_name www.example.com www.example2.com;     listen         80;      client_max_body_size 2000m;     proxy_read_timeout 6000;      location / {         include     uwsgi_params;         uwsgi_pass  unix:/home/project/path/to/project.sock;     }  } 

currently can access urls using both domains want configure specified above.

create server block exclusively server_name single location matches /custom only.

server {     server_name www.example.com     ...     location / {         ...     } }   server {     server_name www.example2.com     ...     location /custom {         ...     } } 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -