0

I want to deploy a project in with the base url www.example.com/project_name. How can I achieve this? I can successfully deploy it to www.example.com, but I need to deploy it in first way.

edit:
I'm using gunicorn for production and running following command
gunicorn project_name.wsgi:application --timeout 600 --workers 10 --log-level=debug --reload --bind=0.0.0.0:9090

Nginx Entry is:

location /project_name {
            proxy_pass http://192.168.0.101:9090;
            proxy_set_header Host $http_host;
            proxy_set_header REMOTE_ADDR $remote_addr;
    }
Dheerendra
  • 1,488
  • 5
  • 19
  • 36

1 Answers1

0

I solved this problem by setting SCRIPT_NAME in nginx directives.

location /project_name {
    proxy_pass http://192.168.0.101:9090;
    proxy_set_header Host $http_host;
    proxy_set_header SCRIPT_NAME /project_name;
    proxy_set_header PATH_INFO /project_name;
    proxy_set_header REMOTE_ADDR $remote_addr;
}
Dheerendra
  • 1,488
  • 5
  • 19
  • 36