RRus

joomla-nginx

Apr 20th, 2021
617
348 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.     listen 80;
  3.     server_name site.ru;
  4.     return 301 https://site.ru$request_uri;
  5. }
  6.  
  7. server {
  8.     listen 443 ssl;
  9.     server_name site.ru;
  10.     root /var/www/site.ru;
  11.     index index.php;
  12.  
  13.     add_header X-Content-Type-Options nosniff;
  14. #   add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
  15.  
  16.     error_log /var/log/nginx/site.ru.error.log;
  17.     access_log /var/log/nginx/site.ru.access.log;
  18.  
  19.     location / {
  20.         try_files $uri $uri/ /index.php?$args;
  21.     }
  22.  
  23.     location = /favicon.ico {
  24.         access_log off;
  25.     }
  26.     location = /robots.txt {
  27.         access_log off;
  28.     }
  29.  
  30.     location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
  31.         return 403;
  32.         error_page 403 /403_error.html;
  33.     }
  34.  
  35.     location ~* \.(jpg|jpeg|gif|png|bmp|ico|js|html|htm|css|swf|flv|txt|rtf|odt|ods|doc|xls|ppt|pdf)$ {
  36.         expires 1d;
  37.     }
  38.  
  39.     location ~ \.php$ {
  40.         fastcgi_pass unix:/var/run/php/php7.4-fpm.sock
  41.         fastcgi_index index.php;
  42.         include fastcgi_params;
  43.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  44.         include snippets/fastcgi-php.conf;
  45.         }  
  46.      
  47.     location ~ /\.svn {
  48.         deny all;
  49.     }
  50.    
  51.     location ~ /\.git {
  52.         deny all;
  53.     }
  54.    
  55.     location ~ /\.hg {
  56.         deny all;
  57.     }
  58.  
  59. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×