Advertisement
anton_slim

nginx subdomain config

Aug 16th, 2015
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. original post from: http://anton-slim.com/?p=219
  2.  
  3. server {
  4. server_name *.debian;
  5. charset utf-8;
  6.  
  7. set $subdomain "";
  8. if ($host ~* ^([a-z0-9-\.]+)\.debian$) {
  9. set $subdomain $1;
  10. }
  11. if ($host ~* ^www.local$) {
  12. set $subdomain "";
  13. rewrite ^ http://debian permanent;
  14. }
  15.  
  16. root /home/slim/subdomains/$subdomain;
  17. client_max_body_size 32M;
  18.  
  19. access_log /home/slim/logs/access.nginx.log main;
  20. error_log /home/slim/logs/error.nginx.log error;
  21.  
  22. location / {
  23. index index.html index.php;
  24. try_files $uri $uri/ =404;
  25. }
  26.  
  27. location ~ \.php$ {
  28. include snippets/fastcgi-php.conf;
  29.  
  30. # With php5-cgi alone:
  31. #fastcgi_pass 127.0.0.1:9000;
  32. # With php5-fpm:
  33. fastcgi_pass unix:/var/run/php5-fpm.sock;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement