siparker
08-04-15, 17:44
alo mwen aktyèl nginx config kòm tankou ki pi ba
Te kapab ou te souple conseiller de testaman pou vbet. èdi/chit cheve (m konprann sa yo gen pou fè tès Et sont esansyèlman kondwi.)
gwo moso mwen espesifikman te konsène osijè de se sa pa afekte Katab /blog/ ki gen wordpress.
server {
listen 80;
#listen [::]:80 default ipv6only=on;
server_name www.mydomain.com mydomain.com;
root /home/user/domains/mydomain.com/public_html;
access_log /home/user/domains/mydomain.com/logs/access.log;
error_log /home/user/domains/mydomain.com/logs/error.log;
index index.php index.html index.htm;
error_page 404 /404.html;
location / {
try_files $uri $uri/ /dbseo.php;
}
location /blog/ {
index index.php;
rewrite ^/blog/(.*)+$ /blog/index.php?$1; # it finally works
}
location ~ ^((?!dbseo).)*\.php$
{
rewrite ^/(.*)$ /dbseo.php last;
}
# Pass PHP scripts to PHP-FPM
location ~ \.php$ {
try_files $uri =403;
fastcgi_split_path_info ^(/blog)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm-username.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Enable browser cache for CSS / JS
location ~* \.(?:css|js)$ {
expires 30d;
add_header Pragma "public";
add_header Cache-Control "public";
add_header Vary "Accept-Encoding";
}
# Enable browser cache for static files
location ~* \.(?:ico|jpg|jpeg|gif|png|bmp|webp|tiff|svg|svgz|pdf|mp3|flac|ogg|mid|midi|wav|mp4|webm|mkv|og$
expires 60d;
add_header Pragma "public";
add_header Cache-Control "public";
}
# Deny access to hidden files
location ~ (^|/)\. {
deny all;
}
}
Te kapab ou te souple conseiller de testaman pou vbet. èdi/chit cheve (m konprann sa yo gen pou fè tès Et sont esansyèlman kondwi.)
gwo moso mwen espesifikman te konsène osijè de se sa pa afekte Katab /blog/ ki gen wordpress.
server {
listen 80;
#listen [::]:80 default ipv6only=on;
server_name www.mydomain.com mydomain.com;
root /home/user/domains/mydomain.com/public_html;
access_log /home/user/domains/mydomain.com/logs/access.log;
error_log /home/user/domains/mydomain.com/logs/error.log;
index index.php index.html index.htm;
error_page 404 /404.html;
location / {
try_files $uri $uri/ /dbseo.php;
}
location /blog/ {
index index.php;
rewrite ^/blog/(.*)+$ /blog/index.php?$1; # it finally works
}
location ~ ^((?!dbseo).)*\.php$
{
rewrite ^/(.*)$ /dbseo.php last;
}
# Pass PHP scripts to PHP-FPM
location ~ \.php$ {
try_files $uri =403;
fastcgi_split_path_info ^(/blog)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm-username.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Enable browser cache for CSS / JS
location ~* \.(?:css|js)$ {
expires 30d;
add_header Pragma "public";
add_header Cache-Control "public";
add_header Vary "Accept-Encoding";
}
# Enable browser cache for static files
location ~* \.(?:ico|jpg|jpeg|gif|png|bmp|webp|tiff|svg|svgz|pdf|mp3|flac|ogg|mid|midi|wav|mp4|webm|mkv|og$
expires 60d;
add_header Pragma "public";
add_header Cache-Control "public";
}
# Deny access to hidden files
location ~ (^|/)\. {
deny all;
}
}