63 lines
2.1 KiB
Plaintext
63 lines
2.1 KiB
Plaintext
server {
|
|
listen 18280;
|
|
server_name _;
|
|
gzip on;
|
|
gzip_min_length 1k;
|
|
gzip_comp_level 9;
|
|
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
|
|
gzip_vary on;
|
|
gzip_disable "MSIE [1-6]\.";
|
|
|
|
root dist;
|
|
include mime.types;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# location /login {
|
|
# proxy_pass http://127.0.0.1:28280/login;
|
|
# proxy_set_header Host $host;
|
|
# proxy_set_header X-Real-IP $remote_addr;
|
|
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
# }
|
|
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:28280/;
|
|
client_max_body_size 100M;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location /dev-api/ {
|
|
proxy_pass http://127.0.0.1:28280/;
|
|
client_max_body_size 100M;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location /file/ {
|
|
proxy_pass http://127.0.0.1:9000/;
|
|
client_max_body_size 5000M;
|
|
proxy_redirect off;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
error_page 405 =200 $request_uri;
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
|
|
add_header 'Access-Control-Max-Age' 1728000;
|
|
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
|
add_header 'Content-Length' 0;
|
|
return 204;
|
|
}
|
|
}
|
|
}
|