2019-03-19 07:54:41 +08:00
|
|
|
server {
|
|
|
|
|
listen 80 default;
|
|
|
|
|
server_name _;
|
|
|
|
|
|
2019-12-19 19:51:28 +08:00
|
|
|
access_log /data/nginx-access.log;
|
|
|
|
|
error_log /data/nginx-error.log;
|
2019-03-19 07:54:41 +08:00
|
|
|
|
2019-12-19 19:51:28 +08:00
|
|
|
root /pinry/pinry-spa/dist/;
|
2019-03-19 07:54:41 +08:00
|
|
|
|
|
|
|
|
location /static {
|
|
|
|
|
alias /data/static;
|
|
|
|
|
expires max;
|
|
|
|
|
access_log off;
|
|
|
|
|
}
|
2020-07-17 22:07:56 +08:00
|
|
|
location /media {
|
|
|
|
|
alias /data/static/media;
|
|
|
|
|
expires max;
|
|
|
|
|
access_log off;
|
|
|
|
|
}
|
2019-03-19 07:54:41 +08:00
|
|
|
|
2019-12-08 01:29:17 +08:00
|
|
|
location /api {
|
2019-03-19 07:54:41 +08:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
|
proxy_pass http://localhost:8000;
|
2019-12-08 01:29:17 +08:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-24 16:16:18 +08:00
|
|
|
location /admin {
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
|
proxy_pass http://localhost:8000;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-08 01:29:17 +08:00
|
|
|
location / {
|
2020-05-11 19:07:37 +09:00
|
|
|
try_files $uri $uri/ /index.html;
|
2019-12-08 01:29:17 +08:00
|
|
|
access_log off;
|
2019-03-19 07:54:41 +08:00
|
|
|
}
|
|
|
|
|
}
|