nginx-vhost.conf 897 B

123456789101112131415161718192021222324252627282930313233343536
  1. server {
  2. listen 443 ssl http2;
  3. server_name twiscord.pw;
  4. index index.html;
  5. root /home/salvarez/www/twiscord.pw/build;
  6. ssl_certificate /etc/letsencrypt/live/twiscord.pw/fullchain.pem;
  7. ssl_certificate_key /etc/letsencrypt/live/twiscord.pw/privkey.pem;
  8. include /etc/letsencrypt/options-ssl-nginx.conf;
  9. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
  10. error_page 405 = $uri;
  11. location /api {
  12. alias /home/salvarez/www/twiscord.pw/api;
  13. try_files $uri /main.php =404;
  14. location ~ \.php$ {
  15. include snippets/fastcgi-php.conf;
  16. fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  17. fastcgi_param SCRIPT_FILENAME /home/salvarez/www/twiscord.pw/api/main.php;
  18. }
  19. }
  20. }
  21. server {
  22. listen 443 ssl http2;
  23. server_name www.twiscord.pw;
  24. return 301 https://twiscord.pw$request_uri;
  25. }
  26. server {
  27. listen 80;
  28. server_name twiscord.pw www.twiscord.pw;
  29. return 301 https://twiscord.pw$request_uri;
  30. }