Modification for two servers
This commit is contained in:
parent
49554c01c8
commit
c7d0f7d1e1
4 changed files with 98 additions and 39 deletions
43
nginx-server-common.conf
Normal file
43
nginx-server-common.conf
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
access_log /var/log/nginx/fic.access_log;
|
||||
error_log /var/log/nginx/fic.error_log;
|
||||
|
||||
root /var/www/fic2014-server/htdocs;
|
||||
index index.php;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=2592000; includeSubdomains";
|
||||
|
||||
location / {
|
||||
if (-f $request_filename) {
|
||||
break;
|
||||
}
|
||||
if (-d $request_filename) {
|
||||
break;
|
||||
}
|
||||
|
||||
rewrite ^/(.*)$ /index.php?p=$1 last;
|
||||
}
|
||||
|
||||
location ~* \favicon.ico$ {
|
||||
access_log off;
|
||||
expires 1d;
|
||||
add_header Cache-Control public;
|
||||
}
|
||||
|
||||
location ~ ^/(img|js|css)/ {
|
||||
access_log off;
|
||||
expires 7d;
|
||||
add_header Cache-Control public;
|
||||
}
|
||||
|
||||
location ~ /(\.ht|\.git|\.svn|\.onyx) {
|
||||
return 403;
|
||||
}
|
||||
|
||||
location ~ .*.php$
|
||||
{
|
||||
if (!-e $document_root$document_uri) { return 404; }
|
||||
include /etc/nginx/fastcgi.conf;
|
||||
fastcgi_pass unix:/var/run/fastcgi/php-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
break;
|
||||
}
|
||||
Reference in a new issue