Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user www-data;
- worker_processes 4;
- pid /var/run/nginx.pid;
- events {
- worker_connections 768;
- # multi_accept on;
- }
- http {
- ##
- # Basic Settings
- ##
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 65;
- types_hash_max_size 2048;
- # server_tokens off;
- # server_names_hash_bucket_size 64;
- # server_name_in_redirect off;
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- ##
- # Logging Settings
- ##
- #access_log /var/log/nginx/access.log;
- #error_log /var/log/nginx/error.log;
- access_log /home/fx/sites/logs/access.log;
- error_log /home/fx/sites/logs/error.log;
- ##
- # Gzip Settings
- ##
- gzip on;
- gzip_disable "msie6";
- # gzip_vary on;
- # gzip_proxied any;
- # gzip_comp_level 6;
- # gzip_buffers 16 8k;
- # gzip_http_version 1.1;
- # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
- ##
- # Virtual Host Configs
- ##
- #include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
- server {
- # IP, который мы будем слушать
- listen 192.168.1.5:80;
- charset utf-8;
- index index.html index.php;
- error_page 404 /404.php;
- server_name xxe.ru *.xxe.ru;
- root /home/fx/sites/$subdomain.xxe;
- set $subdomain "default";
- if ($host ~* ^([a-z0-9-\.]+)\.xxe.ru$) {
- set $subdomain $1;
- }
- if ($host ~* ^www.xxe.ru$) {
- set $subdomain "default";
- }
- #location ~ ([0-9]+)\.begin$ {
- # IP и порт, на которых висит node.js
- # proxy_pass http://192.168.1.5:$1;
- # proxy_set_header Host $host;
- #}
- location ~ \.(php|begin)$ {
- fastcgi_pass 127.0.0.1:9000;
- #fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /home/fx/sites/$subdomain.xxe$fastcgi_script_name;
- fastcgi_read_timeout 360000;
- include fastcgi_params;
- }
- location / {
- if ($subdomain = auto){
- rewrite ^/api/(.*)$ /parser.php$1;
- rewrite "^/([0-9]{1,10})$" /?id=$1;
- rewrite "^/search/([0-9]{1,10})$" /?searchId=$1;
- rewrite "^/archive/([0-9]{1,10})(\-.*)?" /parser.php?q=archive&archiveId=$1;
- }
- }
- }
- # include /etc/nginx/sites-enabled/*;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement