Advertisement
Guest User

nginx

a guest
Jan 2nd, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.14 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     listen [::]:80;
  4.  
  5.     server_name sendy.server.com;
  6.  
  7.     autoindex off;
  8.     index index.php index.html;
  9.  
  10.     root /var/www/html/sendy;
  11.     access_log /var/www/logs/sendy/access.log;
  12.     error_log /var/www/logs/sendy/error.log;
  13.  
  14.     location / {
  15.         try_files $uri $uri/ $uri.php?$args;
  16.     }
  17.  
  18.     location /l/ {
  19.         rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
  20.     }
  21.  
  22.     location /t/ {
  23.         rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
  24.     }
  25.  
  26.     location /w/ {
  27.         rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
  28.     }
  29.  
  30.     location /unsubscribe/ {
  31.         rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
  32.     }
  33.  
  34.     location /subscribe/ {
  35.         rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
  36.     }
  37.  
  38.     location ~ \.php$ {
  39.         try_files $uri =404;
  40.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  41.         fastcgi_pass unix:/var/run/php5-fpm.sock;
  42.         fastcgi_index index.php;
  43.         include fastcgi_params;
  44.     }
  45.  
  46.     location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  47.         access_log off;
  48.         log_not_found off;
  49.         expires 30d;
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement