-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx_default.conf
41 lines (39 loc) · 1.42 KB
/
nginx_default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
server {
listen 80;
server_name localhost; ##ignored if there is only one server block
charset utf-8;
client_max_body_size 75M;
# no oprator after location means it is a prefix match
location /public/web/frontend {
alias /frontend/;
autoindex off;
}
# try_files _ @xxx means don't look at any file go to xxx block
#Turn around /public/api to /api/public because Python has to be one way and kong the other
location /public/api {
rewrite ^/public/api(.*)$ /api/public$1 break;
try_files _ @yourapplication;
}
location /private/api {
rewrite ^/private/api(.*)$ /api/private$1 break;
try_files _ @yourapplication;
}
#This redirect didn't work. The location seems to select but:
#http://127.0.0.1/public/web/apidocs/swaggerui/bower/swagger-ui/dist/droid-sans.css
#got an nginx 404 Dosen't work with or without trailing slash on alias
#location /public/web/apidocs/swaggerui/bower/swagger-ui/dist {
# alias /usr/lib/python3.6/site-packages/baseapp_for_restapi_backend_with_swagger/static/;
# autoindex off;
#}
location /public/web/apidocs {
rewrite ^/public/web(/apidocs.*)$ /$1 break;
try_files $1 @yourapplication;
}
#location / {
# try_files _ @yourapplication;
#}
location @yourapplication {
include uwsgi_params;
uwsgi_pass unix:/app/uwsgi.sock;
}
}