centos 8
    /etc/nginx/conf.d/default.conf

    1. server {
    2. #listen 443 ssl;
    3. listen 80;
    4. root /usr/share/nginx/html;
    5. #server_name touchfish.tech;
    6. server_name localhost;
    7. #ssl_certificate touchfish.tech_bundle.crt;
    8. #ssl_certificate_key touchfish.tech.key;
    9. #ssl_session_timeout 5m;
    10. #ssl_protocols TLSv1.2 TLSv1.3;
    11. #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    12. #ssl_prefer_server_ciphers on;
    13. #access_log /var/log/nginx/host.access.log main;
    14. location / {
    15. try_files $uri $uri/ @router;
    16. proxy_pass CDN上的html文件地址;
    17. #index index.html index.htm index.php;
    18. }
    19. location @router {
    20. rewrite ^.*$ / last;
    21. }
    22. #error_page 404 /404.html;
    23. # redirect server error pages to the static page /50x.html
    24. #
    25. error_page 500 502 503 504 /50x.html;
    26. location = /50x.html {
    27. root /usr/share/nginx/html;
    28. }
    29. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    30. #
    31. #location ~ \.php$ {
    32. # proxy_pass http://127.0.0.1;
    33. #}
    34. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    35. #
    36. location ~ \.php$ {
    37. fastcgi_pass 127.0.0.1:9000;
    38. fastcgi_index index.php;
    39. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    40. include fastcgi_params;
    41. }
    42. # deny access to .htaccess files, if Apache's document root
    43. # concurs with nginx's one
    44. #
    45. #location ~ /\.ht {
    46. # deny all;
    47. #}
    48. location ~ \.(gif|jpg|png|css|js|ico)$ {
    49. expires 100d;
    50. }
    51. }