Skip to content

Instantly share code, notes, and snippets.

@ecylmz
Created September 21, 2011 18:00
Show Gist options
  • Save ecylmz/1232813 to your computer and use it in GitHub Desktop.
Save ecylmz/1232813 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name .for.ce.omu.edu.tr;
include base.conf;
location / {
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
expires 30d;
access_log off;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin)$ $scheme://$host$uri/ permanent;
if (!-e $request_filename) {
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}
location /static {
alias /srv/www/$host/src/static;
}
location /asset {
alias /srv/www/$host/src/asset;
}
location /ders {
alias /srv/www/$host/src/static/ders;
}
location /data {
alias /srv/www/$host/src/data;
}
rewrite ^/(bil[0-9][0-9]+)/*$ /ders/$1 redirect;
location /t/ {
expires 30d;
access_log off;
try_files $uri $uri/ /t/index.php?q=$uri&$args;
}
}
server {
listen 443;
server_name .for.ce.omu.edu.tr;
include base.conf;
# ssl on;
# ssl_certificate /etc/ssl/private/star_omu_edu_tr.crt;
# ssl_certificate_key /etc/ssl/private/star_omu_edu_tr.key;
location /a/ {
expires 30d;
access_log off;
try_files $uri $uri/ /a/index.php?q=$uri&$args;
}
location /z/ {
expires 30d;
access_log off;
try_files $uri $uri/ /z/index.php?q=$uri&$args;
}
location /static {
alias /srv/www/$host/src/static;
}
location /asset {
alias /srv/www/$host/src/asset;
}
location /ders {
alias /srv/www/$host/src/static/ders;
}
rewrite ^/(bil[0-9][0-9]+)/*$ /ders/$1 redirect;
location /t/ {
expires 30d;
access_log off;
try_files $uri $uri/ /t/index.php?q=$uri&$args;
}
location /b/ {
expires 30d;
access_log off;
try_files $uri $uri/ /b/index.php?q=$uri&$args;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment