| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- upstream agent_server_php_http {
- server 172.16.0.42:8001;
- }
- server {
- listen 80;
- # listen 443 ssl;
- # ssl_certificate /opt/secure/ssl/ipx.mx.crt;
- # ssl_certificate_key /opt/secure/ssl/ipx.mx.key;
- # ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
- # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- client_max_body_size 20M;
- server_name a1s.vip58.xyz;
- charset UTF-8;
- index default.html default.htm index.html index.htm;
- # 防止目录浏览
- autoindex off;
- # 防止.htaccess文件被请求
- location ~ /\.ht {
- access_log off;
- deny all;
- }
- # 访问日志:
- access_log /var/log/nginx/proxy_agent_server.access.log;
- error_log /var/log/nginx/proxy_agent_server.error.log;
- # 跨域
- set $cors_credentials '';
- set $cors_content_type '';
- set $cors_content_length '';
- if ($http_origin ~ '.+') {
- set $cors_credentials 'true';
- }
- if ($request_method = OPTIONS) {
- set $cors_content_type 'text/plain';
- set $cors_content_length '0';
- }
- add_header Access-Control-Allow-Origin $http_origin always;
- add_header Access-Control-Allow-Credentials $cors_credentials always;
- add_header Access-Control-Allow-Methods $http_access_control_request_method always;
- add_header Access-Control-Allow-Headers $http_access_control_request_headers always;
- add_header Content-Type $cors_content_type;
- add_header Content-Length $cors_content_length;
- if ($request_method = OPTIONS) {
- return 204;
- }
- location / {
- proxy_pass http://agent_server_php_http;
- proxy_http_version 1.1;
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Real-PORT $remote_port;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header HTTP-REAL-IP $remote_port;
- proxy_set_header HTTP-REAL-HOST $host;
- proxy_set_header Connection '';
- chunked_transfer_encoding off;
- proxy_buffering off;
- proxy_cache off;
- proxy_connect_timeout 120;
- proxy_read_timeout 120;
- proxy_send_timeout 120;
- proxy_buffer_size 32k;
- proxy_buffers 4 32k;
- proxy_busy_buffers_size 64k;
- proxy_temp_file_write_size 256k;
- }
- }
|