1. # power by www.php.cn
  2. #user nobody;
  3. worker_processes 1;
  4.  
  5. #error_log logs/error.log;
  6. #error_log logs/error.log notice;
  7. #error_log logs/error.log info;
  8.  
  9. #pid logs/nginx.pid;
  10.  
  11. events {
  12. worker_connections 4096;
  13. }
  14.  
  15. http {
  16. include mime.types;
  17. default_type application/octet-stream;
  18.  
  19. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  20. # '$status $body_bytes_sent "$http_referer" '
  21. # '"$http_user_agent" "$http_x_forwarded_for"';
  22.  
  23. #access_log logs/access.log main;
  24.  
  25. sendfile on;
  26. #tcp_nopush on;
  27.  
  28. #keepalive_timeout 0;
  29. keepalive_timeout 65;
  30. #tcp_nodelay on;
  31. fastcgi_connect_timeout 300;
  32. fastcgi_send_timeout 300;
  33. fastcgi_read_timeout 300;
  34. fastcgi_buffer_size 128k;
  35. fastcgi_buffers 4 128k;
  36. fastcgi_busy_buffers_size 256k;
  37. fastcgi_temp_file_write_size 256k;
  38.  
  39. #gzip on;
  40. gzip on;
  41. gzip_min_length 1k;
  42. gzip_buffers 4 32k;
  43. gzip_http_version 1.1;
  44. gzip_comp_level 2;
  45. gzip_types text/plain application/x-javascript text/css application/xml;
  46. gzip_vary on;
  47. gzip_disable "MSIE [1-6].";
  48.  
  49. server_names_hash_bucket_size 128;
  50. client_max_body_size 100m;
  51. client_header_buffer_size 256k;
  52. large_client_header_buffers 4 256k;
  53.  
  54. server {
  55. listen 80;
  56. server_name localhost;
  57.  
  58. #charset koi8-r;
  59.  
  60. #access_log logs/host.access.log main;
  61. root "D:/phpstudy/PHPTutorial/WWW";
  62. location / {
  63. index index.html index.htm index.php l.php;
  64. autoindex off;
  65. }
  66.  
  67. #error_page 404 /404.html;
  68.  
  69. # redirect server error pages to the static page /50x.html
  70. #
  71. error_page 500 502 503 504 /50x.html;
  72. location = /50x.html {
  73. root html;
  74. }
  75.  
  76. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  77. #
  78. #location ~ \.php$ {
  79. # proxy_pass http://127.0.0.1;
  80. #}
  81.  
  82. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  83. #
  84. location ~ \.php(.*)$ {
  85. fastcgi_pass 127.0.0.1:9000;
  86. fastcgi_index index.php;
  87. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  88. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  89. fastcgi_param PATH_INFO $fastcgi_path_info;
  90. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  91. include fastcgi_params;
  92. }
  93.  
  94. # deny access to .htaccess files, if Apache's document root
  95. # concurs with nginx's one
  96. #
  97. #location ~ /\.ht {
  98. # deny all;
  99. #}
  100. }
  101.  
  102. ############################
  103. #以下是移民虚拟主机配置
  104. server {
  105. listen 80;
  106. server_name hzym.com;
  107. root "D:\phpstudy\PHPTutorial\WWW\www.welltrend.com.cn\www";
  108.  
  109. location / {
  110. index index.php index.html index.htm;
  111. if (!-e $request_filename) {
  112. rewrite ^(.*)$ /index.php?s=$1 last;
  113. break;
  114. }
  115. }
  116.  
  117. error_page 500 502 503 504 /50x.html;
  118. location = /50x.html {
  119. root html;
  120. }
  121.  
  122. location ~ \.php(.*)$ {
  123. fastcgi_pass 127.0.0.1:9000;
  124. fastcgi_index index.php;
  125. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  126. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  127. fastcgi_param PATH_INFO $fastcgi_path_info;
  128. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  129. include fastcgi_params;
  130. include fastcgi.conf;
  131. }
  132. }
  133. server {
  134. listen 80;
  135. server_name m.hzym.com;
  136. root "D:\phpstudy\PHPTutorial\WWW\www.welltrend.com.cn\www";
  137.  
  138. location / {
  139. index index.php index.html index.htm;
  140. if (!-e $request_filename) {
  141. rewrite ^(.*)$ /index.php?s=$1 last;
  142. break;
  143. }
  144. }
  145.  
  146. error_page 500 502 503 504 /50x.html;
  147. location = /50x.html {
  148. root html;
  149. }
  150.  
  151. location ~ \.php(.*)$ {
  152. fastcgi_pass 127.0.0.1:9000;
  153. fastcgi_index index.php;
  154. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  155. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  156. fastcgi_param PATH_INFO $fastcgi_path_info;
  157. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  158. include fastcgi_params;
  159. }
  160. }
  161. ###############以下是留学虚拟主机配置#############
  162. server {
  163. listen 80;
  164. server_name lx.com;
  165. root "D:\phpstudy\PHPTutorial\WWW\liuxue";
  166.  
  167. location / {
  168. index index.php index.html index.htm;
  169. if (!-e $request_filename) {
  170. rewrite ^(.*)$ /index.php?s=$1 last;
  171. break;
  172. }
  173. }
  174.  
  175. error_page 500 502 503 504 /50x.html;
  176. location = /50x.html {
  177. root html;
  178. }
  179.  
  180. location ~ \.php(.*)$ {
  181. fastcgi_pass 127.0.0.1:9000;
  182. fastcgi_index index.php;
  183. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  184. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  185. fastcgi_param PATH_INFO $fastcgi_path_info;
  186. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  187. include fastcgi_params;
  188. }
  189. }
  190.  
  191. #留学移动端虚拟主机配置#
  192. server {
  193. listen 80;
  194. server_name m.lx.com;
  195. root "D:\phpstudy\PHPTutorial\WWW\m.welltrend-edu.com\public";
  196.  
  197. location / {
  198. index index.php index.html index.htm;
  199. if (!-e $request_filename) {
  200. rewrite ^(.*)$ /index.php?s=$1 last;
  201. break;
  202. }
  203. }
  204.  
  205. error_page 500 502 503 504 /50x.html;
  206. location = /50x.html {
  207. root html;
  208. }
  209.  
  210. location ~ \.php(.*)$ {
  211. fastcgi_pass 127.0.0.1:9000;
  212. fastcgi_index index.php;
  213. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  214. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  215. fastcgi_param PATH_INFO $fastcgi_path_info;
  216. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  217. include fastcgi_params;
  218. }
  219. }
  220. ########################################
  221. ##########################laravel #
  222.  
  223. server {
  224. listen 80;
  225. #server_name blog.com; #暂时关闭这个域名
  226. #root "D:\phpstudy\PHPTutorial\WWW\laravel\blog\public";
  227.  
  228. location / {
  229. index index.php server.php index.html index.htm ;
  230. try_files $uri $uri/ /index.php?$query_string;
  231. if (!-e $request_filename) {
  232. rewrite ^(.*)$ /index.php?s=$1 last;
  233. break;
  234. }
  235. }
  236.  
  237. error_page 500 502 503 504 /50x.html;
  238. location = /50x.html {
  239. root html;
  240. }
  241. location ~ \.php(.*)$ {
  242. fastcgi_pass 127.0.0.1:9000;
  243. fastcgi_index index.php;
  244. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  245. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  246. fastcgi_param PATH_INFO $fastcgi_path_info;
  247. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  248. include fastcgi_params;
  249. }
  250.  
  251. }
  252. #weibo jiekou
  253. server {
  254. listen 80;
  255. server_name test.open.lixiaowang.top;
  256. root "D:\phpstudy\PHPTutorial\WWW\laravel\blog\public";
  257.  
  258. location / {
  259. index index.php server.php index.html index.htm ;
  260. try_files $uri $uri/ /index.php?$query_string;
  261. if (!-e $request_filename) {
  262. rewrite ^(.*)$ /index.php?s=$1 last;
  263. break;
  264. }
  265. }
  266.  
  267. error_page 500 502 503 504 /50x.html;
  268. location = /50x.html {
  269. root html;
  270. }
  271. location ~ \.php(.*)$ {
  272. fastcgi_pass 127.0.0.1:9000;
  273. fastcgi_index index.php;
  274. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  275. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  276. fastcgi_param PATH_INFO $fastcgi_path_info;
  277. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  278. include fastcgi_params;
  279. }
  280.  
  281. }
  282.  
  283. ###################weibo#####################
  284. server {
  285. listen 80;
  286. #server_name test.open.lixiaowang.top;
  287. root "D:\phpstudy\PHPTutorial\WWW\2018bak/libweibo-master/";
  288.  
  289. location / {
  290. index index.php server.php index.html index.htm ;
  291. try_files $uri $uri/ /index.php?$query_string;
  292. if (!-e $request_filename) {
  293. rewrite ^(.*)$ /index.php?s=$1 last;
  294. break;
  295. }
  296. }
  297.  
  298. error_page 500 502 503 504 /50x.html;
  299. location = /50x.html {
  300. root html;
  301. }
  302. location ~ \.php(.*)$ {
  303. fastcgi_pass 127.0.0.1:9000;
  304. fastcgi_index index.php;
  305. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  306. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  307. fastcgi_param PATH_INFO $fastcgi_path_info;
  308. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  309. include fastcgi_params;
  310. }
  311.  
  312. }
  313. ###################QQ登录#####################
  314. server {
  315. listen 80;
  316. server_name qq.open.lixiaowang.top;
  317. root "D:\phpstudy\PHPTutorial\WWW\2018bak/qqConnect2.1/";
  318.  
  319. location / {
  320. index index.php server.php index.html index.htm ;
  321. try_files $uri $uri/ /index.php?$query_string;
  322. if (!-e $request_filename) {
  323. rewrite ^(.*)$ /index.php?s=$1 last;
  324. break;
  325. }
  326. }
  327.  
  328. error_page 500 502 503 504 /50x.html;
  329. location = /50x.html {
  330. root html;
  331. }
  332. location ~ \.php(.*)$ {
  333. fastcgi_pass 127.0.0.1:9000;
  334. fastcgi_index index.php;
  335. fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  336. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  337. fastcgi_param PATH_INFO $fastcgi_path_info;
  338. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  339. include fastcgi_params;
  340. }
  341.  
  342. }
  343.  
  344. ########################################
  345.  
  346. # another virtual host using mix of IP-, name-, and port-based configuration
  347. #
  348. #server {
  349. # listen 8000;
  350. # listen somename:8080;
  351. # server_name somename alias another.alias;
  352.  
  353. # location / {
  354. # root html;
  355. # index index.html index.htm;
  356. # }
  357. #}
  358.  
  359. # HTTPS server
  360. #
  361. #server {
  362. # listen 443;
  363. # server_name localhost;
  364.  
  365. # ssl on;
  366. # ssl_certificate cert.pem;
  367. # ssl_certificate_key cert.key;
  368.  
  369. # ssl_session_timeout 5m;
  370.  
  371. # ssl_protocols SSLv2 SSLv3 TLSv1;
  372. # ssl_ciphers HIGH:!aNULL:!MD5;
  373. # ssl_prefer_server_ciphers on;
  374.  
  375. # location / {
  376. # root html;
  377. # index index.html index.htm;
  378. # }
  379. #}
  380.  
  381. include vhosts.conf;
  382.  
  383. }

NGINX.conf配置文件支持pathinfo的更多相关文章

  1. Nginx(二)------nginx.conf 配置文件

    上一篇博客我们将 nginx 安装在 /usr/local/nginx 目录下,其默认的配置文件都放在这个目录的 conf 目录下,而主配置文件 nginx.conf 也在其中,后续对 nginx 的 ...

  2. [原]生产环境下的nginx.conf配置文件(多虚拟主机)

    [原]生产环境下的nginx.conf配置文件(多虚拟主机) 2013-12-27阅读110 评论0 我的生产环境下的nginx.conf配置文件,做了虚拟主机设置的,大家可以根据需求更改,下载即可在 ...

  3. Nginx入门讲解——初步认识了解nginx.conf配置文件以及配置多个虚拟主机

    本文引自网络进攻学习之用https://blog.csdn.net/weixin_38111957/article/details/81080539 一. 引言上节文章讲述了如何用信号控制Nginx服 ...

  4. [转]Nginx+ThinkPHP不支持PathInfo的解决办法

    FROM : http://www.4wei.cn/archives/1001174 应集团要求,公司的服务器全收到集团机房统一管理了,失去了服务器的管理配置权限. 杯具就此开始. 首先要解决文件大小 ...

  5. Nginx.conf 配置文件详细说明

    在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户user www-data;    #启动进程,通常设置成和cpu的数量相等worker_process ...

  6. Nginx nginx.conf配置文件详细说明

    在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户user www-data;    #启动进程,通常设置成和cpu的数量相等worker_process ...

  7. nginx.conf配置文件里的upstream加入健康检查

    查看NGINX启用了那些模块: # ./nginx -V Tengine version: Tengine/ (nginx/) built by gcc (Red Hat -) (GCC) TLS S ...

  8. Nginx的nginx.conf配置文件中文注释说明

    #运行用户    user www-data;        #启动进程,通常设置成和cpu的数量相等    worker_processes  1;    #全局错误日志及PID文件    erro ...

  9. nginx.conf配置文件的简单说明

    #nginx 监听原理 先监听端口 --> 再配置域名 -->匹配到就访问local 否则 没有匹配到域名就默认访问第一个监听端口的local地址# vi nginx.conf user ...

随机推荐

  1. anaconda查看删除增加镜像源

    # 查看显示原来的镜像源(base) [jiangshan@localhost ~]$ conda config --showadd_anaconda_token: Trueadd_pip_as_py ...

  2. JAVA框架 Mybaits 动态代理

    一.动态代理: mybaits给咱们提供一套动态代理,我们只需要按他的要求写接口即可,mybatis帮做动态代理,相当于咱们写的接口的实现类.底层通过反射实例化代理对象,通过代理对象调用相应的方法, ...

  3. 编写陈旭,实现通过字符型变量创建boolean值,再将其转换为字符串输出,观察输出后的字符串与创建Boolean对象时给定的参数是否相等.

    主要涉及到基本数据类型与包装类的转换. Boolean类的tostring方法的作用,返回一个表示该布尔值的 String 对象 public class Test1 { public static ...

  4. jQuery对底部导航进行跳转并高亮显示

    这两天弄一个mui的底部菜单,有点费时了,尝试了用vue写,纯js写,还有根据mui的写,还是有些问题和麻烦.直到看了网上的一些例子,才想明白,之前一直是一种点击触发事件才高亮的思维去做,这个虽然可以 ...

  5. CGAL学习:数据类型

    CGAL 4.13 - Number Types 1 Introduction(介绍:略) 涉及到的数大致有3种:一是整数,二是有理数,三是浮点数.有理数可以用2个整数表示.精度上可分为任意精度和固定 ...

  6. ASP HUOSHAN VIDEO

    <html> <head> <meta http-equiv="Content-Type" content="text/html; char ...

  7. 20155330 《网络对抗》 Exp7 网络欺诈防范

    20155330 <网络对抗> Exp7 网络欺诈防范 基础问题回答 通常在什么场景下容易受到DNS spoof攻击 连接局域网的时,特别是在商场或是别的公众较多的场合连接的免费WIFI. ...

  8. Nuget包CommonServiceLocator从1.0.3升级到2.0.4时MvvmLight的ViewModelLocator初始化SimpleIoc.Default格式不匹配问题

    原文:Nuget包CommonServiceLocator从1.0.3升级到2.0.4时MvvmLight的ViewModelLocator初始化SimpleIoc.Default格式不匹配问题 把旧 ...

  9. Android开发——进程间通信之Messenger

    0.  前言 不论是Android还是其他操作系统,都会有自己的IPC机制,所谓IPC(Inter-Process Communication)即进程间通信.首先线程和进程是很不同的概念,线程是CPU ...

  10. 如何查看哪个进程,使用了哪个CPU

    某些时候,我们需要知道,在Unix/Linux 环境中,CPU究竟消耗在了哪些进程上面. 如下是最简单的方法: ps -elF