Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #user 'example' virtual host 'example.ru' configuration file
- server {
- server_name www.example.ru;
- return 301 $scheme://example.ru$request_uri;
- }
- server {
- server_name example.ru;
- charset off;
- disable_symlinks if_not_owner from=$root_path;
- index index.html index.php;
- root $root_path;
- set $root_path /var/www/example/data/www/example.ru;
- access_log /var/www/httpd-logs/example.ru.access.log ;
- error_log /var/www/httpd-logs/example.ru.error.log notice;
- include /etc/nginx/vhosts-includes/*.conf;
- include /etc/nginx/vhosts-resources/example.ru/*.conf;
- location / {
- #limit_conn addr 3;
- location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
- try_files $uri $uri/ @fallback;
- expires 30m;
- }
- location / {
- try_files /does_not_exists @fallback;
- }
- location ~ [^/]\.ph(p\d*|tml)$ {
- try_files /does_not_exists @fallback;
- }
- }
- location @fallback {
- proxy_pass http://127.0.0.1:8080;
- proxy_redirect http://127.0.0.1:8080 /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- access_log off ;
- }
- ssi on;
- listen IP_ADDRESS:80;
- return 301 https://example.ru:443$request_uri;
- }
- server {
- server_name example.ru;
- charset off;
- disable_symlinks if_not_owner from=$root_path;
- index index.html index.php;
- root $root_path;
- set $root_path /var/www/example/data/www/example.ru;
- access_log /var/www/httpd-logs/example.ru.access.log ;
- error_log /var/www/httpd-logs/example.ru.error.log notice;
- include /etc/nginx/vhosts-includes/*.conf;
- include /etc/nginx/vhosts-resources/example.ru/*.conf;
- location / {
- #limit_conn addr 3;
- location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
- try_files $uri $uri/ @fallback;
- expires 30m;
- }
- location / {
- try_files /does_not_exists @fallback;
- }
- location ~ [^/]\.ph(p\d*|tml)$ {
- try_files /does_not_exists @fallback;
- }
- }
- location @fallback {
- proxy_pass http://127.0.0.1:8080;
- proxy_redirect http://127.0.0.1:8080 /;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- access_log off ;
- }
- ssi on;
- add_header Strict-Transport-Security "max-age=31536000;";
- listen IP_ADDRESS:443;
- ssl on;
- ssl_certificate "/var/www/httpd-cert/example/example.ru.crtca";
- ssl_certificate_key "/var/www/httpd-cert/example/example.ru.key";
- ssl_ciphers ********************** // hide;
- ssl_prefer_server_ciphers on;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement