server {
listen 10.0.2.15:80;
server_name torrent33.net
root /home/admin/web/torrent33.net/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/torrent33.net.log combined;
access_log /var/log/nginx/domains/torrent33.net.bytes bytes;
error_log /var/log/nginx/domains/torrent33.net.error.log error;
location / {
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires 30d;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias /home/admin/web/torrent33.net/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location = /sitemap.xml {
rewrite ^/sitemap.xml$ /internal_data/sitemap/sitemap.xml;
}
location /internal_data {
rewrite ^/internal_data/atom/(.*) /atom$1 break;
}
location /category {
rewrite ^/category-(.*)-(.*).html /index.php?$2 last;
}
location /forum {
rewrite ^/forum-(.*)-(.*).html /viewforum.php?$2 last;
}
location /topic {
rewrite ^/topic-(.*)-(.*).html /viewtopic.php?$2 last;
}
location /profile {
rewrite ^/profile-(.*)-(.*).html /profile.php?$2 last;
}
location ~ \.(.*sql|tpl|db|inc|log|md)|(config|common).php$ {
deny all;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
#include /home/admin/conf/web/nginx.torrent33.net.conf*;
}