SHARE
TWEET

nginx

a guest Jan 2nd, 2015 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top