#user nobody; worker_processes auto; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log access.log main; sendfile on; #tcp_nopush on; client_max_body_size 2000m; #keepalive_timeout 0; keepalive_timeout 70; gzip on; gzip_disable "msie6"; gzip_min_length 1k; gzip_comp_level 3; gzip_static on; gzip_buffers 4 16k; gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; gzip_vary on; map $status $error_msg { default "Error"; 500 "Internal Server Error"; 502 "Bad Gateway"; 503 "Service Temporarily Unavailable"; 504 "Gateway Timeout"; 400 "Bad Request"; 401 "Unauthorized"; 403 "Forbidden"; 404 "Not Found"; 408 "Request Timeout"; 418 "I\'m a teapot"; } map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 7580; listen [::]:7580; server_name frontend; # 强制将所有重定向设置为特定协议和主机 port_in_redirect off; absolute_redirect off; proxy_redirect off; proxy_set_header Host geomodel.onesis.cn; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Port 443; location / { root /usr/share/nginx/html/; index index.html; try_files $uri $uri/ /index.html; # error_page 404 502 /index.html; # proxy_connect_timeout 60; # proxy_read_timeout 600; } include location_api.conf; include location_jupyter.conf; } }