/etc/nginx/conf.d/api.conf

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