log_format auth_log ' $remote_addr => $host | $request $status | [$time_iso8601] $request_uri $http_user_agent'; upstream auth_socket { server 127.0.0.1:9966; } upstream auth_http { server 127.0.0.1:2345; } server { listen 80; server_name auth.cc auth.com; root /Users/Can/auth/web; index index.htm; listen 443 ssl; ssl_certificate /Users/Can/Projects/shopping/else/config/server.crt; ssl_certificate_key /Users/Can/Projects/shopping/else/config/server.key; ssl_prefer_server_ciphers on; location ~ /(-|\+|api)/(?.*) { access_log /Users/Can/Develop/nginx/auth.txt auth_log; proxy_pass http://auth_http; # /$1?$args; add_header IP $remote_addr; add_header From HttpServer; add_header X-Forwarde-For $proxy_add_x_forwarded_for; etag on; } location ~ /(font|logo) { root /Users/Can/auth; } location ~ /img { root /Users/Can/wecat; } location ~ /(:admin)/.*$ { proxy_pass http://auth_socket; add_header From "auth"; proxy_read_timeout 1000d; # 1000 day proxy_send_timeout 1000d; # 1000 day proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } location ~ ^/product { try_files /product.htm 404; } location ~ ^/[^.]*$ { try_files /index.htm 404; } location ~ ^/lib { add_header JS-type Library; add_header Access-Control-Allow-Origin "$http_origin"; expires 2h; } location ~ ^.*(js|htm|css)$ { # Keep the global root # kill cache # add_header Last-Modified $date_gmt; # add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; # if_modified_since off; add_header Cache-Control "max-age=0"; # 304 add_header Some-Thing "What"; expires off; etag off; } }