nginx-xyz-https.conf 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. user nginx;
  2. worker_processes 8;
  3. error_log /var/error.log info;
  4. worker_rlimit_nofile 10240;
  5. events {
  6. worker_connections 8192;
  7. multi_accept on;
  8. use epoll;
  9. }
  10. http
  11. {
  12. include mime.types;
  13. default_type application/octet-stream;
  14. fastcgi_buffer_size 32k;
  15. fastcgi_buffers 8 32k;
  16. underscores_in_headers on;
  17. client_max_body_size 1024M;
  18. sendfile on;
  19. keepalive_timeout 65;
  20. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  21. '$status $body_bytes_sent "$http_referer" '
  22. '"$http_user_agent" "$http_x_forwarded_for"';
  23. server
  24. {
  25. listen 443 ssl;
  26. set $folder_name /var/www/html;
  27. server_name www.xyzshops.cn;
  28. root $folder_name;
  29. ssl_certificate cert/www.xyzshops.cn.pem;
  30. ssl_certificate_key cert/www.xyzshops.cn.key;
  31. ssl_session_cache shared:SSL:1m;
  32. ssl_session_timeout 5m;
  33. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #使用此加密套件。
  34. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #使用该协议进行配置。
  35. ssl_prefer_server_ciphers on;
  36. index index.html index.php;
  37. client_max_body_size 100m;
  38. proxy_connect_timeout 500s;
  39. proxy_read_timeout 500s;
  40. proxy_send_timeout 500s;
  41. fastcgi_connect_timeout 75;
  42. fastcgi_read_timeout 600;
  43. fastcgi_send_timeout 600;
  44. charset utf-8;
  45. location /logs {
  46. deny all;
  47. return 403;
  48. }
  49. location /data/log {
  50. deny all;
  51. return 403;
  52. }
  53. location / {
  54. index index.html index.htm index.php;
  55. }
  56. location /mshop {
  57. root $folder_name;
  58. autoindex on;
  59. index index.html index.htm index.php;
  60. try_files $uri $uri/ /mshop/index.html;
  61. }
  62. location /plot {
  63. root $folder_name;
  64. proxy_pass http://172.26.105.127:5000;
  65. proxy_redirect off;
  66. proxy_set_header Host $host;
  67. proxy_set_header X-Real-IP $remote_addr;
  68. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  69. proxy_set_header X-Forwarded-Proto $scheme;
  70. }
  71. location /merchant {
  72. root $folder_name;
  73. autoindex on;
  74. index index.html index.htm index.php;
  75. try_files $uri $uri/ /merchant/index.html;
  76. }
  77. location ~ /mobile/[/\w]+\.php$ {
  78. root $folder_name;
  79. fastcgi_pass docker.hostip:9100;
  80. fastcgi_index index.php;
  81. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  82. fastcgi_param SIGN $http_sign;
  83. include fastcgi_params;
  84. }
  85. location ~ /mobile/[/\w]+\.html$ {
  86. try_files $uri $uri/ /mobile/index.html;
  87. }
  88. location ~ /racc/[/\w]+\.php$ {
  89. root $folder_name;
  90. fastcgi_pass docker.hostip:9101;
  91. fastcgi_index index.php;
  92. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  93. fastcgi_param SIGN $http_sign;
  94. include fastcgi_params;
  95. }
  96. location ~ /mchsrv/[/\w]+\.php$ {
  97. root $folder_name;
  98. fastcgi_pass docker.hostip:9102;
  99. fastcgi_index index.php;
  100. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  101. fastcgi_param SIGN $http_sign;
  102. include fastcgi_params;
  103. }
  104. location ~ \.php$ {
  105. add_header Cache-Control no-store;
  106. root $folder_name;
  107. fastcgi_pass docker.hostip:9000;
  108. fastcgi_index index.php;
  109. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  110. include fastcgi_params;
  111. }
  112. }
  113. server
  114. {
  115. listen 443 ssl;
  116. set $folder_name /var/www/html;
  117. server_name xyzshops.cn;
  118. root $folder_name;
  119. ssl_certificate cert/www.xyzshops.cn.pem;
  120. ssl_certificate_key cert/www.xyzshops.cn.key;
  121. ssl_session_cache shared:SSL:1m;
  122. ssl_session_timeout 5m;
  123. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #使用此加密套件。
  124. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #使用该协议进行配置。
  125. ssl_prefer_server_ciphers on;
  126. index index.html index.php;
  127. client_max_body_size 100m;
  128. proxy_connect_timeout 500s;
  129. proxy_read_timeout 500s;
  130. proxy_send_timeout 500s;
  131. fastcgi_connect_timeout 75;
  132. fastcgi_read_timeout 600;
  133. fastcgi_send_timeout 600;
  134. charset utf-8;
  135. location /logs {
  136. deny all;
  137. return 403;
  138. }
  139. location /data/log {
  140. deny all;
  141. return 403;
  142. }
  143. location / {
  144. index index.html index.htm index.php;
  145. }
  146. location /mshop {
  147. root $folder_name;
  148. autoindex on;
  149. index index.html index.htm index.php;
  150. try_files $uri $uri/ /mshop/index.html;
  151. }
  152. location /plot {
  153. root $folder_name;
  154. proxy_pass http://172.26.105.127:5000;
  155. proxy_redirect off;
  156. proxy_set_header Host $host;
  157. proxy_set_header X-Real-IP $remote_addr;
  158. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  159. proxy_set_header X-Forwarded-Proto $scheme;
  160. }
  161. location /merchant {
  162. root $folder_name;
  163. autoindex on;
  164. index index.html index.htm index.php;
  165. try_files $uri $uri/ /merchant/index.html;
  166. }
  167. location ~ /mobile/[/\w]+\.php$ {
  168. root $folder_name;
  169. fastcgi_pass docker.hostip:9100;
  170. fastcgi_index index.php;
  171. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  172. fastcgi_param SIGN $http_sign;
  173. include fastcgi_params;
  174. }
  175. location ~ /mobile/[/\w]+\.html$ {
  176. try_files $uri $uri/ /mobile/index.html;
  177. }
  178. location ~ /racc/[/\w]+\.php$ {
  179. root $folder_name;
  180. fastcgi_pass docker.hostip:9101;
  181. fastcgi_index index.php;
  182. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  183. fastcgi_param SIGN $http_sign;
  184. include fastcgi_params;
  185. }
  186. location ~ /mchsrv/[/\w]+\.php$ {
  187. root $folder_name;
  188. fastcgi_pass docker.hostip:9102;
  189. fastcgi_index index.php;
  190. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  191. fastcgi_param SIGN $http_sign;
  192. include fastcgi_params;
  193. }
  194. location ~ \.php$ {
  195. add_header Cache-Control no-store;
  196. root $folder_name;
  197. fastcgi_pass docker.hostip:9000;
  198. fastcgi_index index.php;
  199. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  200. include fastcgi_params;
  201. }
  202. }
  203. server
  204. {
  205. listen 80;
  206. set $folder_name /var/www/html;
  207. server_name 121.89.223.81;
  208. root $folder_name;
  209. index index.html index.php;
  210. client_max_body_size 100m;
  211. proxy_connect_timeout 500s;
  212. proxy_read_timeout 500s;
  213. proxy_send_timeout 500s;
  214. fastcgi_connect_timeout 75;
  215. fastcgi_read_timeout 600;
  216. fastcgi_send_timeout 600;
  217. charset utf-8;
  218. location /logs {
  219. deny all;
  220. return 403;
  221. }
  222. location /data/log {
  223. deny all;
  224. return 403;
  225. }
  226. location / {
  227. index index.html index.htm index.php;
  228. }
  229. location ~ \.php$ {
  230. add_header Cache-Control no-store;
  231. root $folder_name;
  232. fastcgi_pass docker.hostip:9000;
  233. fastcgi_index index.php;
  234. fastcgi_param SCRIPT_FILENAME $folder_name$fastcgi_script_name;
  235. include fastcgi_params;
  236. }
  237. }
  238. }