#user nobody; user nginx; worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/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"'; error_log /dev/stdout warn; access_log /dev/stdout main; sendfile on; #tcp_nopush on; keepalive_timeout 65; proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; gzip on; gzip_buffers 4 16k; gzip_comp_level 6; gzip_types text/plain application/javascript text/css application/xml text/javascript application/x-httpd-php; gzip_static on; gzip_http_version 1.1; gzip_proxied expired no-cache no-store private auth; server { listen ${NGINX_PORT}; listen [::]:${NGINX_PORT}; charset utf-8; client_max_body_size ${NGINX_MAX_BODY_SIZE}; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location /api { rewrite ^/api/(.*)$ /tianhui-admin-web/$1 break; proxy_pass ${API_SERVER}; } location /profile { proxy_pass ${API_SERVER}/tianhui-admin-web/profile/; } location /thinking { rewrite ^/thinking/(.*)$ /tianhui-admin-web/$1 break; proxy_pass ${API_SERVER}; } } }