nginx.conf 997 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. server {
  2. server_name twongd.shotshock.shop;
  3. root /var/www/twong/public;
  4. index index.php index.html;
  5. location ^~ /mobilex/ {
  6. alias /var/www/twong/public/mobilex/;
  7. }
  8. location / {
  9. if (!-e $request_filename) {
  10. rewrite ^(.*)$ /index.php?s=$1 last;
  11. break;
  12. }
  13. }
  14. location ~ \.php {
  15. include fastcgi.conf;
  16. fastcgi_pass unix:/run/php/php7.2-fpm.sock;
  17. }
  18. listen 443 ssl; # managed by Certbot
  19. ssl_certificate /etc/letsencrypt/live/twong.shotshock.shop/fullchain.pem; # managed by Certbot
  20. ssl_certificate_key /etc/letsencrypt/live/twong.shotshock.shop/privkey.pem; # managed by Certbot
  21. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  22. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  23. }
  24. # 转向 https
  25. server {
  26. if ($host = twongd.shotshock.shop) {
  27. return 301 https://$host$request_uri;
  28. } # managed by Certbot
  29. listen 80;
  30. server_name twongd.shotshock.shop;
  31. return 404; # managed by Certbot
  32. }