Advertisement
Guest User

nginx ssl config

a guest
Feb 12th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. upstream backend-wwwdomen1 {server unix:/var/run/php5-wwwdomen1.sock;}
  2.  
  3. server {
  4. listen 80;
  5. server_name domen1;
  6. location / {
  7. rewrite ^/(.*)$ https://domen1/$1 permanent;
  8. }
  9. }
  10.  
  11. server {
  12. listen 443;
  13. server_name domen1;
  14. root /home/domen1/www;
  15. access_log /home/domen1/logs/access.log;
  16. error_log /home/domen1/logs/error.log;
  17. index index.php index.html;
  18. rewrite_log on;
  19. server_tokens off;
  20. #SSL configuration
  21. ssl on;
  22. ssl_certificate /home/wwwdomen1/ssl/domen1_ca.crt;
  23. ssl_certificate_key /home/wwwdomen1/ssl/domen1_ca.key;
  24. ssl_session_timeout 5m;
  25. ssl_protocols SSLv2 SSLv3 TLSv1;
  26. ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  27.  
  28. location / {
  29. try_files $uri $uri/ @rewrite;
  30. }
  31.  
  32. location @rewrite {
  33. rewrite ^/(.*)$ /index.php?q=$1;
  34. }
  35. location ~ \.php$ {
  36. include fastcgi_params;
  37. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  38. fastcgi_pass backend-wwwdomen1;
  39. }
  40. location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|bmp|map)$ {
  41. access_log off;
  42. expires 10d;
  43. break;
  44. }
  45. location ~ /\.ht {
  46. deny all;
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement