Advertisement
BimoSora

error nginx

Nov 10th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. server {
  2. listen :192.168.0.2:443 ssl;
  3.  
  4. root /usr/share/nginx/html/;
  5. index index.html index.htm index.nginx-debian.html index.php;
  6.  
  7. server_name www.example.com;
  8.  
  9. # ssl on;
  10. ssl_certificate /etc/ssl/example.pem;
  11. ssl_certificate_key /etc/ssl/example.key;
  12.  
  13. location / {
  14. try_files $uri $uri.html $uri/ @extensionless-php;
  15. index index.html index.htm index.php;
  16. }
  17.  
  18. location /id {
  19. if (!-e $request_filename){
  20. rewrite ^(.*)$ /$1.php;
  21. }
  22. error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 https://www.gonitechnology.com/id/error;
  23. }
  24.  
  25. location ~ \.php$ {
  26. try_files $uri = 404;
  27. include fastcgi_params;
  28. fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  29. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  30. fastcgi_intercept_errors on;
  31. fastcgi_split_path_info ^(.+\.php)(.*)$;
  32. fastcgi_cache phpcache;
  33. fastcgi_cache_valid 200 301 302 15m;
  34. add_header X-FastCGI-Cache $upstream_cache_status;
  35.  
  36. fastcgi_hide_header X-Powered-By;
  37.  
  38. }
  39.  
  40. location ~ /\.ht {
  41. deny all;
  42. }
  43.  
  44. location ~ \.css {
  45. add_header Content-Type text/css;
  46. }
  47.  
  48. location ~ \.js {
  49. add_header Content-Type application/x-javascript;
  50. }
  51.  
  52. location ~ \.(jpg|jpeg|gif|png|ico|html|xml|txt)$ {
  53.  
  54. }
  55. }
  56. server {
  57. listen 192.168.0.2:443 ssl;
  58. server_name example.com;
  59. return 301 $scheme://www.example.com$request_uri;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement