Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://server/site02.
- # Site 01
- location / {
- root /var/www/site01;
- index index.html index.php index.htm;
- try_files $uri $uri/ /index.php;
- location = /index.php {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_read_timeout 10000;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_buffer_size 16K;
- fastcgi_buffers 256 16k;
- include fastcgi_params;
- }
- }
- # Site 2
- location /site02 {
- root /var/www/;
- index index.htm;
- try_files $uri $uri/ /index.php;
- location ~ ^/site02/index.php {
- try_files $uri =404;
- root /var/www/;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_read_timeout 10000;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_buffer_size 16K;
- fastcgi_buffers 256 16k;
- include /etc/nginx/fastcgi_params;
- }
- }
- location /site02 {
- root /var/www/;
- index index.htm;
- location /site02 {
- root /var/www/;
- index index.php index.htm;
- location /site02 {
- root /var/www/;
- index index.php index.htm;
- try_files $uri $uri/ /site02/index.php;
- location ~ ^/site02/(.+.php)$ {
- root /var/www;
- try_files $uri $uri/ /site02/index.php;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_read_timeout 10000;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_buffer_size 16K;
- fastcgi_buffers 256 16k;
- include fastcgi_params;
- }
- }
- server{
- ......
- ......
- root /var/www/;
- index index.html index.php index.htm;
- location / {
- try_files $uri $uri/ /index.php;
- }
- # Site 1
- location /site01 {
- .....your parameters here...
- }
- # Site 2
- location /site02 {
- .....your parameters here...
- }
- location ~ .php$ {
- try_files $uri =404;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_read_timeout 10000;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_buffer_size 16K;
- fastcgi_buffers 256 16k;
- include fastcgi_params;
- }
- }
- root /var/www/html/;
- server_name example.com;
- # Site 01
- location /site1 {
- alias /var/www/html/site1/;
- index index.htm index.php;
- try_files $uri $uri/ /site1/index.php;
- }
- # Site 2
- location /site2 {
- alias /var/www/html/site2/;
- index index.htm index.php;
- try_files $uri $uri/ /site2/index.php;
- }
- error_page 404 /error/404.php;
- fastcgi_intercept_errors on;
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- location ~ .php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/run/php/php7.0-fpm.sock;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement