nginx.conf

浅浅的花香味﹌ 2022-10-02 00:31 42阅读 0赞

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

  1. #user nobody;
  2. worker_processes 4;
  3. worker_cpu_affinity 0001 0010 0100 1000;
  4. worker_rlimit_nofile 65535;
  5. error_log logs/error.log;
  6. #error_log logs/error.log notice;
  7. #error_log logs/error.log info;
  8. #pid logs/nginx.pid;
  9. events {
  10. use epoll;
  11. worker_connections 65535;
  12. }
  13. http {
  14. include mime.types;
  15. default_type application/octet-stream;
  16. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  17. '$status $body_bytes_sent "$http_referer" '
  18. '"$http_user_agent" "$http_x_forwarded_for"';
  19. access_log logs/access.log main;
  20. sendfile on;
  21. #tcp_nopush on;
  22. #keepalive_timeout 0;
  23. keepalive_timeout 65;
  24. gzip on;
  25. gzip_min_length 1000;
  26. gzip_types text/plain text/css text/xml application/x-javascript application/xml application/json;
  27. server {
  28. listen 80;
  29. server_name 120.76.233.70;
  30. charset utf-8;
  31. access_log logs/ning.access.log main;
  32. index index.jsp index.html index.do index.action;
  33. #root /home/tomcat/webapps/ROOT/;
  34. #location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
  35. #{
  36. # root /home/tomcat/webapps/ROOT/;
  37. # expires 7d;
  38. #}
  39. #location ~ (\.jsp)|(\.do)|(\.action)$
  40. location /
  41. {
  42. proxy_pass http://localhost:8080/;
  43. proxy_redirect off;
  44. proxy_set_header HOST $host;
  45. proxy_set_header X-Real-IP $remote_addr;
  46. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47. client_max_body_size 10m;
  48. client_body_buffer_size 128k;
  49. proxy_connect_timeout 90;
  50. proxy_send_timeout 90;
  51. proxy_read_timeout 90;
  52. proxy_buffer_size 4k;
  53. proxy_buffers 4 32k;
  54. proxy_busy_buffers_size 64k;
  55. proxy_temp_file_write_size 64k;
  56. }
  57. error_page 500 502 503 504 /50x.html;
  58. location = /50x.html {
  59. root html;
  60. }
  61. }
  62. server {
  63. listen 80;
  64. server_name xiaovip.com www.xiaovip.com ningvip.com www.ningvip.com;
  65. charset utf-8;
  66. access_log logs/xiaovip.access.log main;
  67. index index.jsp index.html index.do index.action;
  68. if ($host != 'www.xiaovip.com') {
  69. rewrite ^/(.*)$ http://www.xiaovip.com/$1 permanent;
  70. }
  71. location / {
  72. rewrite ^/(.*)$ /b2g/$1 last;
  73. }
  74. location ^~ /b2g/ {
  75. proxy_pass http://58.62.144.146:8888;
  76. }
  77. location ~* ^/.+$ {
  78. proxy_pass http://58.62.144.146:8888;
  79. }
  80. error_page 500 502 503 504 /50x.html;
  81. location = /50x.html {
  82. root html;
  83. }
  84. }
  85. server {
  86. listen 80;
  87. server_name gp.xiao.com;
  88. charset utf-8;
  89. access_log logs/gp.xiao.access.log main;
  90. index index.jsp index.html index.do index.action;
  91. location / {
  92. proxy_pass http://58.62.144.146:8686;
  93. }
  94. #location ~* ^/.+$ {
  95. # proxy_pass http://58.62.144.146:8686;
  96. #}
  97. error_page 500 502 503 504 /50x.html;
  98. location = /50x.html {
  99. root html;
  100. }
  101. }
  102. server {
  103. listen 80;
  104. server_name www.xiao.com xiao.com www.ning.com ning.com;
  105. charset utf-8;
  106. access_log logs/www.ning.access.log main;
  107. index index.php;
  108. root /var/www/xiao;
  109. if ($host != 'www.xiao.com') {
  110. rewrite ^/(.*)$ http://www.xiao.com/$1 permanent;
  111. }
  112. location ~ .*\.(php|php5)?$ {
  113. fastcgi_pass 127.0.0.1:9000;
  114. fastcgi_index index.php;
  115. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  116. include fastcgi_params;
  117. }
  118. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
  119. expires 30d;
  120. }
  121. location ~ /\.ht {
  122. deny all;
  123. }
  124. include /var/www/xiao/stourweb_conf/nginx/*.conf;
  125. error_page 500 502 503 504 /50x.html;
  126. location = /50x.html {
  127. root html;
  128. }
  129. }
  130. server {
  131. listen 80;
  132. server_name m.xiao.com;
  133. charset utf-8;
  134. access_log logs/m.ning.access.log main;
  135. index index.php index.html index.htm;
  136. root /var/www/xiao/phone;
  137. location ~ .*\.(php|php5)?$ {
  138. fastcgi_pass 127.0.0.1:9000;
  139. fastcgi_index index.php;
  140. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  141. include fastcgi_params;
  142. }
  143. include /var/www/xiao/stourweb_conf/nginx/*.conf;
  144. location ~ /uploads/{
  145. root /var/www/xiao;
  146. }
  147. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
  148. # expires 30d;
  149. }
  150. error_page 500 502 503 504 /50x.html;
  151. location = /50x.html {
  152. root html;
  153. }
  154. }
  155. server {
  156. listen 80;
  157. server_name bbs.xiao.com;
  158. charset utf-8;
  159. access_log logs/bbs.ning.access.log main;
  160. index index.php index.html index.htm;
  161. root /var/www/discuz;
  162. location ~ .*\.(php|php5)?$ {
  163. fastcgi_pass 127.0.0.1:9000;
  164. fastcgi_index index.php;
  165. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  166. include fastcgi_params;
  167. }
  168. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
  169. expires 30d;
  170. }
  171. error_page 500 502 503 504 /50x.html;
  172. location = /50x.html {
  173. root html;
  174. }
  175. }
  176. server {
  177. listen 80;
  178. server_name en.xiao.com;
  179. charset utf-8;
  180. access_log logs/en.ning.access.log main;
  181. index index.php index.html index.htm;
  182. root /var/www/xiao-en;
  183. location ~ .*\.(php|php5)?$ {
  184. fastcgi_pass 127.0.0.1:9000;
  185. fastcgi_index index.php;
  186. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  187. include fastcgi_params;
  188. }
  189. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
  190. expires 30d;
  191. }
  192. error_page 500 502 503 504 /50x.html;
  193. location = /50x.html {
  194. root html;
  195. }
  196. }
  197. server {
  198. listen 80;
  199. server_name www.miao.com miao.com;
  200. charset utf-8;
  201. access_log logs/miao.access.log main;
  202. index index.php index.html index.htm;
  203. root /var/www/miao;
  204. location ~ .*\.(php|php5)?$ {
  205. fastcgi_pass 127.0.0.1:9000;
  206. fastcgi_index index.php;
  207. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  208. include fastcgi_params;
  209. }
  210. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
  211. expires 30d;
  212. }
  213. error_page 500 502 503 504 /50x.html;
  214. location = /50x.html {
  215. root html;
  216. }
  217. }
  218. server {
  219. listen 80;
  220. server_name m.miao.com;
  221. charset utf-8;
  222. access_log logs/m.miao.access.log main;
  223. index index.php index.html index.htm;
  224. root /var/www/miao/mobile;
  225. location ~ .*\.(php|php5)?$ {
  226. fastcgi_pass 127.0.0.1:9000;
  227. fastcgi_index index.php;
  228. fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
  229. include fastcgi_params;
  230. }
  231. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
  232. expires 30d;
  233. }
  234. error_page 500 502 503 504 /50x.html;
  235. location = /50x.html {
  236. root html;
  237. }
  238. }
  239. server {
  240. listen 80;
  241. server_name jipiao.xiao.com;
  242. charset UTF-8;
  243. index index.html index.htm;
  244. root html/jp;
  245. access_log logs/jipiao.access.log main;
  246. location / {
  247. try_files $uri $uri/ /index.html;
  248. #proxy_pass http://114.55.13.89:81;
  249. }
  250. #error_page 404 /404.html;
  251. # redirect server error pages to the static page /50x.html
  252. #
  253. error_page 500 502 503 504 /50x.html;
  254. location = /50x.html {
  255. root html;
  256. }
  257. }
  258. }

转载于:https://my.oschina.net/u/3574106/blog/3052461

发表评论

表情:
评论列表 (有 0 条评论,42人围观)

还没有评论,来说两句吧...

相关阅读

    相关 nginxconf文件下载

    如何编辑nginx.conf 文件 nginx.conf文件为文本类型的文件,可以用任何文本编辑器进行编辑 注意,在windows下,如果使用记事本进行编辑,文件中不能