generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
140c83d
commit f72b817
Showing
1 changed file
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} | ||
|
||
|
||
} |