Advertisement
CSenshi

gravita.conf

May 6th, 2021
2,031
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.71 KB | None | 0 0
  1.  
  2. # Expires map
  3. map $sent_http_content_type $expires {
  4.     default                    off;
  5.     text/html                  epoch;
  6.     text/css                   max;
  7.     application/javascript     max;
  8.     ~image/                    max;
  9. }
  10.  
  11.  
  12. server {
  13.     listen 443 ssl http2;
  14.  
  15.     include snippets/ssl-gravita.conf;
  16.     include snippets/ssl-params.conf;
  17.  
  18.         server_name www.gravita.ge;
  19.         return 301 https://gravita.ge$request_uri;
  20. }
  21.  
  22. server {
  23.         listen 80;
  24.  
  25.         server_name www.gravita.ge gravita.ge;
  26.         return 301 https://gravita.ge$request_uri;
  27. }
  28.  
  29. server {
  30.     listen 443 ssl http2;
  31.     expires $expires;
  32.  
  33.     server_name gravita.ge;
  34.     root /var/www/gravita/public;
  35.  
  36.     include snippets/ssl-gravita.conf;
  37.     include snippets/ssl-params.conf;
  38.  
  39.     add_header X-Frame-Options "SAMEORIGIN";
  40.     add_header X-Content-Type-Options "nosniff";
  41.  
  42.     index index.php;
  43.  
  44.     charset utf-8;
  45.  
  46.     location / {
  47.         try_files $uri $uri/ /index.php?$query_string;
  48.     }
  49.  
  50.     location = /favicon.ico { access_log off; log_not_found off; }
  51.     location = /robots.txt  { access_log off; log_not_found off; }
  52.  
  53.     error_page 404 /index.php;
  54.  
  55.     location ~ \.php$ {
  56.         fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
  57.         fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  58.         include fastcgi_params;
  59.     }
  60.  
  61.     location ~ /\.(?!well-known).* {
  62.         deny all;
  63.     }
  64.  
  65.     location ~* \.(js|css|html)$ {
  66.         expires 365d;
  67.         add_header Cache-Control "public, no-transform";
  68.     }
  69.  
  70.     location ~* \.(png|jpg|jpeg|gif|mp4|svg|woff2|woff|ttf|eot)$ {
  71.         expires 365d;
  72.         add_header Cache-Control "public, no-transform";
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement