Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- listen 443 ssl http2;
- server_name tusdfsdfas.com www.tusdfsdfas.com;
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
- add_header X-Frame-Options "DENY";
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
- ssl on;
- ssl_certificate /etc/ssl/ssl-bundle.crt;
- ssl_certificate_key /etc/ssl/private/www_tusdfsdfas_com.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_prefer_server_ciphers on;
- ssl_ciphers EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4;
- ssl_session_tickets off;
- ssl_session_cache shared:SSL:10m;
- ssl_session_timeout 10m;
- ssl_dhparam /etc/ssl/certs/dhparam.pem;
- resolver 8.8.8.8;
- resolver_timeout 10s;
- # resolver 127.0.0.1 [::1];
- ssl_stapling on;
- ssl_stapling_verify on;
- ssl_trusted_certificate /etc/ssl/ssl-bundle.crt;
- root /var/www/html/magento-testing/;
- #access_log /var/log/nginx/magento-access.log;
- error_log /var/log/nginx/magento-errors.log debug;
- keepalive_timeout 70;
- # Disallow PHP scripts in /media/
- # Also render static 404 pages for missing media
- # location ~ ^/media/ {
- # location ~ \.php$ {
- # return 444;
- # }
- ## Gzip Static module to compress CSS, JS
- location ^~ /media/po_compressor/ {
- gzip_static on;
- expires 365d;
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, max-age=31536000, proxy-revalidate";
- }
- ## Compression
- gzip on;
- gzip_buffers 16 8k;
- gzip_comp_level 4;
- gzip_http_version 1.0;
- gzip_min_length 1280;
- gzip_types text/plain text/xml application/xml application/xml+rss image/x-icon image/bmp;
- gzip_vary on;
- ####################################################################################
- ## Main Magento location
- location / {
- try_files $uri $uri/ @handler;
- # auth_basic "Restricted";
- # auth_basic_user_file /var/www/html/magento/.htpasswd;
- expires 30d;
- # return 444;
- }
- ####################################################################################
- ## These locations would be hidden by .htaccess normally, protected
- location ~ (/(app/|includes/|/pkginfo/|var/|errors/local.xml)|/\.svn/|/.hta.+) {
- deny all;
- #internal;
- }
- ####################################################################################
- ## Stop Image and Document Hijacking
- # location ~* (\.jpg|\.png|\.css)$ {
- # if ($http_referer !~ ^(http://www.tusdfsdfas.com) ) {
- # return 444;
- # }
- # This section allows you specify which IP-addresses can access your admin and downloader areas, replace 1.2.3.4 and 1.2.3.5 with your IPs.
- location /downloader/ {
- #allow 69.221.18.45;
- #allow 1.2.3.5;
- deny all;
- #rewrite ^/downloader/(.*)$ /downloader/index.php$1;
- access_log off; #to prevent from filling up the access log file
- error_log off; #to prevent from filling up the error log file
- return 444;
- }
- #location /admin {
- #allow 1.2.3.4;
- #allow 1.2.3.5;
- #deny all;
- #rewrite / /@handler;
- #}
- # Denied locations require a "^~" to prevent regexes (such as the PHP handler below) from matching
- # http://nginx.org/en/docs/http/ngx_http_core_module.html#location
- location ^~ /app/ { return 444; }
- location ^~ /sales/guest/form { return 444; }
- location ^~ /administrator/ { return 444; }
- location ^~ /wp-login.php { return 444; }
- location ^~ /wp-admin/ { return 444; }
- location ^~ /wp-content/ { return 444; }
- location ^~ /wordpress/ { return 444; }
- location ^~ /assets/ { return 444; }
- location ^~ /plugins/ { return 444; }
- location ^~ /wp/ { return 444; }
- location ^~ /scripts/ { return 444; }
- location ^~ /blog/ { return 444; }
- location ^~ /phpmyadmin/ { return 444; }
- location ^~ /backup/ { return 444; }
- location ^~ /backups/ { return 444; }
- location ^~ /admin/ { return 444; }
- location ^~ /includes/ { return 444; }
- location ^~ /media/downloadable/ { return 444; }
- location ^~ /pkginfo/ { return 444; }
- location ^~ /report/config.xml { return 444; }
- location ^~ /var/ { return 444; }
- location ^~ /lib/ { return 444; }
- location ^~ /dev/ { return 444; }
- location ^~ /rss/ { return 444; }
- location ^~ /RELEASE_NOTES.txt { return 444; }
- location ^~ /downloader/pearlib { return 444; }
- location ^~ /downloader/template { return 444; }
- location ^~ /downloader/Maged { return 444; }
- location ~* ^/errors/.+\.xml { return 444; }
- location /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- #####################################################################################
- ## Images, scripts and styles set far future Expires header
- location ~* \.(js|css|png|jpg|webp|jpeg|gif|ico)$ {
- expires max;
- log_not_found off;
- add_header Pragma public;
- add_header Cache-Control "max-age=31536000, public";
- }
- ####################################################################################
- ## Main Magento location
- location @handler {
- rewrite / /index.php;
- }
- location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
- rewrite ^(.*.php)/ $1 last;
- }
- ## Execute PHP Scripts using FastCGI
- # location ~ \.php(/.*)? {
- # if (!-e $request_filename) {
- # rewrite / /index.php last;
- # }
- location ~ \.php$ {
- try_files $uri /index.php;
- # fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
- expires off;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- ## Tweak fastcgi buffers, just in case.
- fastcgi_buffer_size 256k;
- fastcgi_buffers 256 4k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- #fastcgi_connect_timeout 300;
- #fastcgi_send_timeout 300;
- #fastcgi_read_timeout 300;
- fastcgi_param HTTPS on;
- fastcgi_param HTTP_SCHEME https;
- include fastcgi_params;
- }
- error_page 404 =444 /404.html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement