oak-docker-tools/template/nginx/conf.d/config.conf

64 lines
1.9 KiB
Plaintext

# WebSocket support
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 3021;
server_name 192.168.34.21;
index index.html index.htm index.jsp;
root /usr/share/nginx/html/haina-cn/web;
gzip on;
gzip_min_length 1k;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
location ~ ^/oak-api/.*$ {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri /index.html;
proxy_set_header X-Real-IP $remote_addr;
rewrite /oak-api/(.*) /$1 break;
proxy_read_timeout 1500;
proxy_connect_timeout 1500;
proxy_send_timeout 1500;
send_timeout 1500;
client_max_body_size 10m;
proxy_pass http://192.168.34.21:3011;
}
location ~ ^/oak-skt/.*$ {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri /index.html;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Real-IP $remote_addr;
rewrite /oak-skt/(.*) /$1 break;
proxy_read_timeout 1500;
proxy_connect_timeout 1500;
proxy_send_timeout 1500;
send_timeout 1500;
client_max_body_size 10m;
proxy_pass http://192.168.34.21:8080;
}
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}