Skip to content

Commit

Permalink
Update nginx conf
Browse files Browse the repository at this point in the history
  • Loading branch information
kimachinskiy committed Sep 20, 2023
1 parent 140c83d commit f72b817
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions configs/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,29 +1,59 @@
server {
listen 80;
server_name http://178.212.110.52;
server_name _;
server_tokens off;
client_max_body_size 20M;

# React
location / {
proxy_pass http://frontend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
try_files $uri @proxy_react;
}

# Django API
location /api/ {
try_files $uri @proxy_django;
}

# Django Admin
location /admin {
proxy_pass http://web-dev:8000/admin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
try_files $uri @proxy_django;
}

# PGAdmin
location /pgadmin {
try_files $uri @proxy_pgadmin;
}



location @proxy_django {
proxy_pass http://web-dev:8000;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Url-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}

location @proxy_react {
proxy_pass http://frontend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}

location @proxy_pgadmin {
proxy_pass http://pgadmin/;
proxy_http_version 1.1;
proxy_set_header X-Script-Name /pgadmin;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;

}


}

0 comments on commit f72b817

Please sign in to comment.