Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. http://server/site02.
  2.  
  3. # Site 01
  4. location / {
  5. root /var/www/site01;
  6. index index.html index.php index.htm;
  7.  
  8. try_files $uri $uri/ /index.php;
  9.  
  10. location = /index.php {
  11. fastcgi_pass 127.0.0.1:9000;
  12. fastcgi_read_timeout 10000;
  13. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  14. fastcgi_buffer_size 16K;
  15. fastcgi_buffers 256 16k;
  16. include fastcgi_params;
  17. }
  18. }
  19.  
  20. # Site 2
  21. location /site02 {
  22. root /var/www/;
  23. index index.htm;
  24.  
  25. try_files $uri $uri/ /index.php;
  26.  
  27. location ~ ^/site02/index.php {
  28. try_files $uri =404;
  29. root /var/www/;
  30. fastcgi_pass 127.0.0.1:9000;
  31. fastcgi_index index.php;
  32. fastcgi_read_timeout 10000;
  33. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  34. fastcgi_buffer_size 16K;
  35. fastcgi_buffers 256 16k;
  36. include /etc/nginx/fastcgi_params;
  37. }
  38. }
  39.  
  40. location /site02 {
  41. root /var/www/;
  42. index index.htm;
  43.  
  44. location /site02 {
  45. root /var/www/;
  46. index index.php index.htm;
  47.  
  48. location /site02 {
  49. root /var/www/;
  50. index index.php index.htm;
  51.  
  52. try_files $uri $uri/ /site02/index.php;
  53.  
  54. location ~ ^/site02/(.+.php)$ {
  55. root /var/www;
  56. try_files $uri $uri/ /site02/index.php;
  57. fastcgi_pass 127.0.0.1:9000;
  58. fastcgi_index index.php;
  59. fastcgi_read_timeout 10000;
  60. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  61. fastcgi_buffer_size 16K;
  62. fastcgi_buffers 256 16k;
  63. include fastcgi_params;
  64. }
  65. }
  66.  
  67. server{
  68.  
  69. ......
  70. ......
  71. root /var/www/;
  72. index index.html index.php index.htm;
  73.  
  74. location / {
  75. try_files $uri $uri/ /index.php;
  76.  
  77. }
  78. # Site 1
  79. location /site01 {
  80. .....your parameters here...
  81. }
  82.  
  83. # Site 2
  84. location /site02 {
  85. .....your parameters here...
  86. }
  87.  
  88. location ~ .php$ {
  89. try_files $uri =404;
  90. fastcgi_pass 127.0.0.1:9000;
  91. fastcgi_index index.php;
  92. fastcgi_read_timeout 10000;
  93. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  94. fastcgi_buffer_size 16K;
  95. fastcgi_buffers 256 16k;
  96. include fastcgi_params;
  97. }
  98.  
  99. }
  100.  
  101. root /var/www/html/;
  102. server_name example.com;
  103.  
  104. # Site 01
  105. location /site1 {
  106. alias /var/www/html/site1/;
  107. index index.htm index.php;
  108. try_files $uri $uri/ /site1/index.php;
  109. }
  110.  
  111. # Site 2
  112. location /site2 {
  113. alias /var/www/html/site2/;
  114. index index.htm index.php;
  115. try_files $uri $uri/ /site2/index.php;
  116. }
  117.  
  118. error_page 404 /error/404.php;
  119. fastcgi_intercept_errors on;
  120.  
  121. error_page 500 502 503 504 /50x.html;
  122. location = /50x.html {
  123. root /usr/share/nginx/html;
  124. }
  125.  
  126. location ~ .php$ {
  127. include snippets/fastcgi-php.conf;
  128. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement