api-https.conf 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. server {
  2. listen 19600 ssl;
  3. ssl_certificate /home/openlab/data/config/cret/server.csr;
  4. ssl_certificate_key /home/openlab/data/config/cret/server.key;
  5. ssl_session_timeout 5m;
  6. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  7. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  8. ssl_prefer_server_ciphers on;
  9. access_log /home/openlab/data/logs/nginx/api/access.log;
  10. error_log /home/openlab/data/logs/nginx/api/error.log;
  11. index index.html index.php;
  12. root /home/openlab/data/code/server/server/public/;
  13. # add_header Access-Control-Allow-Origin '*';
  14. # add_header Access-Control-Allow-Headers 'X-Requested-With,Content-Type';
  15. # add_header Access-Control-Allow-Methods 'GET,POST,OPTIONS'
  16. location / {
  17. if (!-e $request_filename) {
  18. rewrite ^/(.*)$ /index.php/$1 last;
  19. break;
  20. }
  21. }
  22. location ~ \.(js|css|gif|jpg|jpeg|png|html)$ {
  23. root /home/openlab/data/code/server/server/public/;
  24. }
  25. # location /dist/ {
  26. # root /data/gitcode/ychz/client/ris;
  27. # index index.html;
  28. # }
  29. location ~ \.php {
  30. include fastcgi_params;
  31. set $script $uri;
  32. set $path_info "";
  33. if ($uri ~ "^(.+\.php)(/.+)") {
  34. set $script $1;
  35. set $path_info $2;
  36. }
  37. fastcgi_read_timeout 120;
  38. fastcgi_pass 127.0.0.1:9000;
  39. # fastcgi_pass unix:/usr/local/php/var/run/php-fpm.sock;
  40. fastcgi_index index.php;
  41. #fastcgi_index index.php?IF_REWRITE=1;
  42. fastcgi_param PATH_INFO $path_info;
  43. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  44. set $real_script_name $fastcgi_script_name;
  45. if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
  46. set $real_script_name $1;
  47. set $path_info $2;
  48. }
  49. fastcgi_param SCRIPT_NAME $real_script_name;
  50. #fastcgi_param SCRIPT_NAME $script;
  51. #include fastcgi_params;
  52. }
  53. }