Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 77.77.77.77:80;
- server_name domaincom *.domaincom;
- root /home/admin/web/domaincom/public_html/subs/$subdomain;
- set $subdomain "";
- if ($host ~* ^([a-z0-9-\.]+)\.domaincom$) {
- set $subdomain $1;
- #rewrite $request_uri $1.$request_uri;
- #rewrite ^(.*txt)$ $subdomain.$request_uri; just testing here
- #rewrite ^(.*\.txt)$ $subdomain.$request_uri/$1;
- }
- if ($host ~* ^www.domaincom$) {
- set $subdomain "";
- }
- # location $subdomain {
- # # # An example rewrite
- # rewrite ^/(.*txt)$ $request_uri;
- # }
- index index.php;
- access_log off;
- error_log /dev/null;
- location / {
- root /home/admin/web/domaincom/public_html;
- location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
- expires max;
- }
- 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:9002;
- fastcgi_index index.php;
- include /etc/nginx/fastcgi_params;
- }
- }
- error_page 403 /error/404.html;
- error_page 404 = @foobar;
- location @foobar {
- return 301 /;
- }
- error_page 500 502 503 504 /error/50x.html;
- location /error/ {
- alias /home/admin/web/domaincom/document_errors/;
- }
- # Access deny for bots
- # See bots list in the /etc/nginx/nginx.conf
- if ($limit_bots = 1) {
- return 403;
- }
- location ~* "/\.(htaccess|htpasswd)$" {
- deny all;
- return 404;
- }
- location /vstats/ {
- alias /home/admin/web/domaincom/stats/;
- include /home/admin/conf/web/domaincom.auth*;
- }
- 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.domaincom.conf*;
- }
Add Comment
Please, Sign In to add comment