Advertisement
niammuddin

config nginx ssl

Oct 9th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen 443 ssl;
  4. server_name www.ucapan.me ucapan.me;
  5. ssl_certificate /etc/nginx/ssl/ucapan_me.crt;
  6. ssl_certificate_key /etc/nginx/ssl/myserver.key;
  7. root /usr/share/nginx/html/ucapan.me/public_html;
  8. index index.php index.html index.htm;
  9.  
  10. if ($host ~* ^www\.(.*))
  11. {
  12. set $host_without_www $1;
  13. rewrite ^/(.*)$ https://$host_without_www/$1 permanent;
  14. }
  15.  
  16. location / {
  17. try_files $uri $uri/ /index.php?q=$uri&$args;
  18. }
  19.  
  20. location ~ \.php$ {
  21. fastcgi_pass unix:/var/run/php5-fpm.sock;
  22. fastcgi_index index.php;
  23. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  24. include fastcgi_params;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement