Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 5.20 KB | None | 0 0
  1. server {
  2.  
  3.     # Ipv4
  4.     listen 80;
  5.    
  6.     # IPv6
  7.     # listen [::]:80;  
  8.    
  9.     # SSL Ipv4 & v6
  10.     # listen 443 ssl;
  11.     # listen [::]:443 ssl;
  12.  
  13.     # ssl_session_timeout 24h;
  14.     # ssl_session_cache shared:SSL:10m;
  15.     # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  16.     # ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:RSA+3DES:AES128-SHA:!ADH:!AECDH:!MD5;
  17.     # ssl_prefer_server_ciphers on;
  18.     # Do not forget to create this file before with OpenSSL : "openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048"
  19.     # ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  20.  
  21.     # Your domain names here
  22.     server_name deareco.dev *.deareco.dev;
  23.  
  24.     #Your website root location
  25.     root /usr/local/var/waynet/deareco;  
  26.  
  27.     error_log /usr/local/var/log/nginx/deareco.access.log;
  28.     access_log /usr/local/var/log/nginx/deareco.error.log;
  29.  
  30.     # Your admin folder
  31.     set $admin_dir /admin265pekha9;
  32.  
  33.     index index.php;
  34.  
  35.     # Gzip Settings, convert all types.
  36.     # gzip on;
  37.     # gzip_vary on;
  38.     # gzip_proxied any;
  39.  
  40.     # Can be enhance to 5, but it can slow you server
  41.     # gzip_comp_level    5;
  42.     # gzip_min_length    256;
  43.  
  44.     # gzip_types
  45.     #     application/atom+xml
  46.     #     application/javascript
  47.     #     application/json
  48.     #     application/ld+json
  49.     #     application/manifest+json
  50.     #     application/rss+xml
  51.     #     application/vnd.geo+json
  52.     #     application/vnd.ms-fontobject
  53.     #     application/x-font-ttf
  54.     #     application/x-web-app-manifest+json
  55.     #     application/xhtml+xml
  56.     #     application/xml
  57.     #     font/opentype
  58.     #     image/bmp
  59.     #     image/svg+xml
  60.     #     image/x-icon
  61.     #     text/cache-manifest
  62.     #     text/css
  63.     #     text/plain
  64.     #     text/vcard
  65.     #     text/vnd.rim.location.xloc
  66.     #     text/vtt
  67.     #     text/x-component
  68.     #     text/x-cross-domain-policy;
  69.         # Supposed to be the case but we never know
  70.         # text/html;
  71.        
  72.     # gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  73.  
  74.     # Old image system ?
  75.     rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last;
  76.     rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
  77.     rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
  78.     rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
  79.     rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
  80.     rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
  81.     rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
  82.     rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
  83.     rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last;
  84.     rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last;
  85.  
  86.     # Symfony controllers
  87.     location ~ /$admin_dir/(international|_profiler|module|product|combination|specific-price)/(.*)$ {
  88.         try_files $uri $uri/ /index.php?q=$uri&$args $admin_dir/index.php$is_args$args;    
  89.     }
  90.  
  91.  
  92.     # Redirect needed to "hide" index.php
  93.     location / {
  94.         try_files $uri $uri/ /index.php$uri$is_args$args;
  95.     }
  96.    
  97.     error_page 404 /index.php?controller=404;
  98.  
  99.     # Static assets delivery optimisations
  100.     add_header Strict-Transport-Security max-age=31536000;
  101.  
  102.     # Cloudflare / Max CDN fix
  103.     location ~* \.(eot|otf|ttf|woff|woff2)$ {
  104.         add_header Access-Control-Allow-Origin *;
  105.     }
  106.  
  107.     location ~* \.(css|js|docx|zip|pptx|swf|txt|jpg|jpeg|png|gif|swf|webp|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$ {
  108.       expires max;
  109.       log_not_found off;
  110.       add_header Pragma public;
  111.       add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  112.     }
  113.  
  114.     # Deny access to .htaccess .DS_Store .htpasswd etc
  115.     location ~ /\. {
  116.         deny all;
  117.     }
  118.  
  119.     # Security for your themes
  120.     location ~ \.tpl {
  121.         deny all;
  122.     }
  123.  
  124.     # PHP 7 FPM part
  125.     location ~ [^/]\.php(/|$) {
  126.  
  127.         fastcgi_index index.php;
  128.  
  129.         # Switch if needed
  130.         # include /etc/nginx/fastcgi_params;
  131.         # include fcgi.conf;
  132.         include fastcgi_params;
  133.  
  134.         # Do not forget to update this part if needed
  135.         fastcgi_pass 127.0.0.1:9000;  
  136.         # fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  137.        
  138.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  139.         fastcgi_keep_conn on;
  140.    
  141.         fastcgi_send_timeout 30s;
  142.         fastcgi_read_timeout 300;
  143.  
  144.         # In case of long loading or 502 / 504 errors
  145.         # fastcgi_buffer_size 256k;
  146.         # fastcgi_buffers 256 16k;
  147.         # fastcgi_busy_buffers_size 256k;
  148.         client_max_body_size 10M;
  149.  
  150.         # Temp file tweak
  151.         fastcgi_max_temp_file_size 0;
  152.         fastcgi_temp_file_write_size 256k;
  153.  
  154.    }
  155.  
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement