Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream website2_my {
- server 127.0.0.1:9002;
- }
- server {
- server_name website2.my www.website2.my;
- root /var/www/website2proj/public;
- index index.php;
- # set max upload size
- client_max_body_size 2G;
- fastcgi_buffers 64 4K;
- access_log /var/log/nginx/website2_http_access.log combined;
- error_log /var/log/nginx/website2_http_error.log;
- gzip on;
- gzip_types text/plain text/css text/javascript image/svg+xml image/x-icon application/javascript application/x-javascript;
- gzip_min_length 1000;
- gzip_vary on;
- gzip_proxied no-cache no-store private expired auth;
- gzip_disable MSIE [1-6];
- server_tokens off;
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location / {
- try_files $uri $uri/ /index.php?$args ;
- }
- location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
- try_files $uri /index.php?$query_string;
- access_log off;
- log_not_found off;
- expires 14d;
- }
- # protected area (XHProf)
- location ^~ /xhprof/xhprof_html/ {
- auth_basic "Restricted";
- auth_basic_user_file /etc/nginx/htpasswd/xhprof;
- location ~ \.php(?:$|/) {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param PHP_FLAG "session.auto_start=off \n mbstring.encoding_translation=off";
- fastcgi_param PHP_VALUE "assert.active=0 \n mbstring.http_input=pass \n mbstring.http_output=pass";
- fastcgi_pass website2_my ;
- fastcgi_read_timeout 60s;
- }
- }
- # protected area (phpmyadmin)
- location ^~ /mysqladmin/ {
- auth_basic "Restricted";
- auth_basic_user_file /etc/nginx/htpasswd/phpmyadmin;
- location ~ \.php(?:$|/) {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param PHP_FLAG "session.auto_start=off \n mbstring.encoding_translation=off";
- fastcgi_param PHP_VALUE "assert.active=0 \n mbstring.http_input=pass \n mbstring.http_output=pass";
- fastcgi_pass website2_my;
- fastcgi_read_timeout 60s;
- }
- }
- location ^~ /wp-admin/install.php {
- auth_basic "Restricted";
- auth_basic_user_file /etc/nginx/htpasswd/wpadmin;
- location ~* \.(htaccess|htpasswd) {
- deny all;
- }
- location ~ \.php(?:$|/) {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/html/xhprof/external/header.php";
- fastcgi_pass website2_my;
- fastcgi_read_timeout 60s;
- }
- }
- location ~* \.(htaccess|htpasswd) {
- deny all;
- }
- location ~* \.(?:ini|conf|txt)$ {
- deny all;
- }
- location ~ \.php(?:$|/) {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/html/xhprof/external/header.php";
- fastcgi_pass website2_my;
- fastcgi_read_timeout 60s;
- }
- # set long EXPIRES header on static assets
- location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
- expires 30d;
- access_log off;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement