Commit dcaa68f79f16f7dcd2b47fcf6dc59daabe39cc3c

Authored by 鲜彤
1 parent 5a75d839

change domain

conf/nginx/conf.d/k-boxing.vchangyi.com.conf
1 1 server {
2 2 listen 80;
3   - server_name k-boxing-rp-topic-api.vchangyi.com;
4   - return 301 https://$host$request_uri;
5   -}
6   -
7   -server {
8   - listen 443 ssl;
  3 + error_log /var/log/nginx/qy.nginx_error.log error;
9 4 server_name k-boxing-rp-topic-api.vchangyi.com;
10 5 index index.html index.htm index.php;
11 6 root /var/www/html/k-boxing.vchangyi.com/www;
12   -
13   - # error_log /var/log/nginx/qy.nginx_error.log error;
14   - ssl on;
15   - ssl_certificate /etc/nginx/conf.d/certs/changyi/1_vchangyi.com_bundle.crt;
16   - ssl_certificate_key /etc/nginx/conf.d/certs/changyi/2_vchangyi.com.key;
17   - ssl_prefer_server_ciphers on;
18   - ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
19   - ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";
20   - add_header Strict-Transport-Security max-age=31536000;
21   -
22   - location ~* ^.+1\.php$ {
23   - access_log /dev/null;
24   - }
25   - location ~* ^.+loadbalanceStatus\.html$ {
26   - access_log /dev/null;
27   - }
28   -
29   - location ~* ^.+.(xls|jpg|jpeg|gif|css|png|js|ico|thumb|xml|swf|txt|woff|ttf|eot|svg|otf|htm|html|apk|map)$ {
  7 + location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|thumb|xml|swf|txt|woff|ttf|eot|svg|otf|htm|html|apk|map)$ {
30 8 # 微信前端 h5
31 9 if ($request_uri ~ ^/([^/]+)/([^/]+)/h5/index.html) {
32 10 rewrite ^/([^/]+)/([^/]+)/h5 /$2/h5/index.html break;
33 11 }
  12 +
34 13 if ($request_uri ~ ^/([^/]+)/([^/]+)/h5/index-dev.html) {
35 14 rewrite ^/([^/]+)/([^/]+)/h5 /$2/h5/index-dev.html break;
36 15 }
  16 +
37 17 if ($request_uri ~ ^/([^/]+)/([^/]+)/h5/(.*)(jpg|jpeg|gif|css|png|js|ico|thumb|xml|swf|txt|woff|ttf|eot|svg|otf|apk)) {
38 18 rewrite ^/([^/]+)/([^/]+)/h5/(.*) /$2/h5/$3 break;
39 19 }
  20 +
40 21 access_log /dev/null;
41 22 expires 10d;
42 23 }
43 24  
44 25 location / {
  26 + index index.html index.htm index.php;
  27 + access_log /var/log/nginx/k-boxing-rp-topic-api.vchangyi.com-access.log combined buffer=32k;
  28 +
45 29 if ($request_uri ~ ^/([^/]+)/([^/]+)/h5) {
46 30 rewrite ^/([^/]+)/([^/]+)/h5 /$2/h5/index.html break;
47 31 }
48   - if ($request_uri = /) {
49   - rewrite ^/ https://$host/admincp/ break;
50   - }
51   - if ($request_uri ~ ^/(\#|\?)) {
52   - rewrite ^/ https://$host/admincp/ break;
53   - }
  32 +
54 33 if ($request_uri ~ ^/admincp) {
55   - break;
  34 + rewrite ^/admincp /admincp/index.html break;
56 35 }
  36 +
57 37 if (!-e $request_filename) {
58 38 rewrite ^/(.*)$ /index.php last;
59 39 break;
60 40 }
61 41 }
  42 +
62 43 location ~ [^/]\.php(/|$) {
63   - #try_files $uri =404;
  44 + try_files $uri =404;
  45 + chunked_transfer_encoding off;
  46 + # fastcgi_pass 127.0.0.1:9000;
  47 + # fastcgi_pass unix:/tmp/php-cgi.sock;
64 48 fastcgi_pass fpm:9000;
65 49 fastcgi_index index.php;
66 50 include fastcgi.conf;
  51 +
67 52 # 设置 PATH_INFO 并改写 SCRIPT_FILENAME, SCRIPT_NAME 服务器环境变量
68 53 set $path_info "";
69 54 set $real_script_name $fastcgi_script_name;
... ... @@ -71,20 +56,24 @@ server {
71 56 set $real_script_name $1;
72 57 set $path_info $2;
73 58 }
74   - fastcgi_param HTTP_HOST 'k-boxing-rp-topic-api.vchangyi.com';
  59 +
75 60 fastcgi_param PATH_INFO $path_info;
76 61 fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
77 62 fastcgi_param SCRIPT_NAME $real_script_name;
78 63 }
79   - location ~ .*\.(jpg|jpeg|gif|css|png|js|ico|thumb|xml|swf|txt|woff|ttf|eot|svg|otf|htm|html|apk|map)$ {
  64 +
  65 + location /nginx_status {
  66 + stub_status on;
  67 + access_log off;
  68 + }
  69 +
  70 + location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
80 71 expires 30d;
81   - access_log /dev/null;
82 72 }
  73 +
83 74 location ~ .*\.(js|css)?$ {
84   - expires 1d;
85   - access_log /dev/null;
  75 + expires 12h;
86 76 }
87 77  
88   - #access_log /data/wwwlogs/k-boxing.vchangyi.com-access$log_date.log;
89   - #access_log /data/wwwlogs/k-boxing.vchangyi.com-access.log access;
90   -}
  78 + access_log off;
  79 +}
91 80 \ No newline at end of file
... ...