Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Expires map
- map $sent_http_content_type $expires {
- default off;
- text/html epoch;
- text/css max;
- application/javascript max;
- ~image/ max;
- }
- server {
- listen 443 ssl http2;
- include snippets/ssl-gravita.conf;
- include snippets/ssl-params.conf;
- server_name www.gravita.ge;
- return 301 https://gravita.ge$request_uri;
- }
- server {
- listen 80;
- server_name www.gravita.ge gravita.ge;
- return 301 https://gravita.ge$request_uri;
- }
- server {
- listen 443 ssl http2;
- expires $expires;
- server_name gravita.ge;
- root /var/www/gravita/public;
- include snippets/ssl-gravita.conf;
- include snippets/ssl-params.conf;
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-Content-Type-Options "nosniff";
- index index.php;
- charset utf-8;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location = /favicon.ico { access_log off; log_not_found off; }
- location = /robots.txt { access_log off; log_not_found off; }
- error_page 404 /index.php;
- location ~ \.php$ {
- fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- include fastcgi_params;
- }
- location ~ /\.(?!well-known).* {
- deny all;
- }
- location ~* \.(js|css|html)$ {
- expires 365d;
- add_header Cache-Control "public, no-transform";
- }
- location ~* \.(png|jpg|jpeg|gif|mp4|svg|woff2|woff|ttf|eot)$ {
- expires 365d;
- add_header Cache-Control "public, no-transform";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement