Advertisement
Guest User

Untitled

a guest
Aug 12th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.64 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     listen 443 http2 ssl;
  4.     server_name usf.u.uniqom.local;
  5.  
  6.     include common/self-signed.conf;
  7.     include common/ssl-params.conf;
  8.  
  9.     root /var/www/usf/public;
  10.     include common/security;
  11.     include common/gzip;
  12.     send_timeout 2m;
  13.     client_header_timeout 2m;
  14.     client_body_timeout 2m;
  15.     fastcgi_read_timeout 60s;
  16.  
  17.     location / {
  18.         # try to serve file directly, fallback to index.php
  19.         try_files $uri /index.php$is_args$args;
  20.     }
  21.  
  22.     #location ~* ^/api(?!/pp) {
  23.     #    proxy_pass http://old.u.uniqom.local;
  24.     #    proxy_set_header ApiHost $http_host;
  25.     #    proxy_set_header X-Forwarded-Proto $scheme;
  26.     #}
  27.  
  28.     #location ~* ^/api {
  29.     #    root /var/www/usf/api/public;
  30.     #    index index.php index.html;
  31.     #    try_files $uri $uri/ index.php$is_args$args;
  32.     #
  33.     #    fastcgi_index index.php;
  34.     #    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  35.     #    fastcgi_split_path_info ^(.+\.php)(/.*)$;
  36.     #    include fastcgi_params;
  37.     #    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  38.     #    fastcgi_param DOCUMENT_ROOT $realpath_root;
  39.     #}
  40.  
  41.     location ~ ^/index\.php(/|$) {
  42.         fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  43.         fastcgi_split_path_info ^(.+\.php)(/.*)$;
  44.         include fastcgi_params;
  45.  
  46.         # optionally set the value of the environment variables used in the application
  47.         # fastcgi_param APP_ENV prod;
  48.         # fastcgi_param APP_SECRET <app-secret-id>;
  49.         # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
  50.  
  51.         # When you are using symlinks to link the document root to the
  52.         # current version of your application, you should pass the real
  53.         # application path instead of the path to the symlink to PHP
  54.         # FPM.
  55.         # Otherwise, PHP's OPcache may not properly detect changes to
  56.         # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  57.         # for more information).
  58.         fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  59.         fastcgi_param DOCUMENT_ROOT $realpath_root;
  60.         # Prevents URIs that include the front controller. This will 404:
  61.         # http://domain.tld/index.php/some-path
  62.         # Remove the internal directive to allow URIs like this
  63.         internal;
  64.     }
  65.  
  66.     # return 404 for all other php files not matching the front controller
  67.     # this prevents access to other php files you don't want to be accessible.
  68.     location ~ \.php$ {
  69.       return 404;
  70.     }
  71.  
  72.     error_log /var/log/nginx/usf_error.log;
  73.     access_log /var/log/nginx/usf_access.log;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement