Skip to content

Instantly share code, notes, and snippets.

@Fi1osof
Created December 11, 2017 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fi1osof/382783330daeba487d444838cab829df to your computer and use it in GitHub Desktop.
Save Fi1osof/382783330daeba487d444838cab829df to your computer and use it in GitHub Desktop.
server {
# listen 127.0.0.1:80;
listen 80;
server_name nocache.shopmodx.ru;
error_log /var/log/nginx/nocache.thumbs.nocache.shopmodx.ru.error_log;
allow 127.0.0.1;
deny all;
root /www/shopmodx.ru/public_html;
location / {
access_log off;
expires 30d;
rewrite ^/images/resized/thumb/(.+)$ /assets/components/modxsite/connectors/thumb.php?&ctx=web&w=150&h=150&zc=1&far=0&q=100&src=$1 last;
rewrite ^/images/resized/marker_thumb/(.+)$ /assets/components/modxsite/connectors/thumb.php?&ctx=web&w=200&h=130&zc=1&far=0&q=100&src=$1 last;
rewrite ^/images/resized/slider_thumb/(.+)$ /assets/components/modxsite/connectors/thumb.php?&ctx=web&w=400&h=300&iar=1&zc=C&q=100&src=$1 last;
rewrite ^/images/resized/slider_dot_thumb/(.+)$ /assets/components/modxsite/connectors/thumb.php?&ctx=web&w=40&h=30&iar=1&zc=C&q=70&src=$1 last;
rewrite ^/images/resized/small/(.+)$ /assets/components/modxsite/connectors/thumb.php?&ctx=web&w=400&h=300&q=100&far=0&zc=1&src=$1 last;
rewrite ^/images/resized/middle/(.+)$ /assets/components/modxsite/connectors/thumb.php?&ctx=web&w=800&h=600q=85&far=0&src=$1 last;
rewrite ^/images/resized/big/(.+)$ /assets/components/modxsite/connectors/thumb.php?&ctx=web&w=1200&h=1000&q=85&far=0&src=$1 last;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_ignore_client_abort on;
fastcgi_read_timeout 600;
fastcgi_param PHP_VALUE "max_execution_time = 0";
fastcgi_param SERVER_NAME shopmodx.ru;
}
}
server {
listen 80;
server_name shopmodx.ru www.shopmodx.ru;
access_log /var/log/nginx/shopmodxbox.ru-access.log;
error_log /var/log/nginx/shopmodxbox.ru-error.log;
rewrite_log on;
root /www/shopmodx.ru/public_html;
client_max_body_size 10m;
location /core/ {
deny all;
}
location ~ ^/images/resized/ {
proxy_cache_key "$host|$request_uri";
proxy_cache thumbs;
proxy_cache_valid 200 1y;
proxy_set_header Host nocache.shopmodx.ru;
proxy_ignore_client_abort on;
proxy_read_timeout 600;
proxy_pass http://127.0.0.1;
access_log off;
}
location ~ ^/manager$ {
rewrite ^ $scheme://$host$uri/ permanent;
}
location ~ \.(map|json|ico)$ {
access_log off;
expires 30d;
}
location ~ ^/(manager|connectors|assets|setup)(/?|$) {
location ~ \.(woff|css|svg|map|img|js|jsx|png|jpg|jpeg|gif|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|ico|map|json)$ {
access_log off;
expires 30d;
}
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass localhost:9000;
}
location /uploads/ {
location ~ \.(woff|css|svg|map|img|js|jsx|png|jpg|jpeg|gif|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf)$ {
access_log off;
expires 30d;
}
}
location ~ /\.ht {
deny all;
}
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 36000;
proxy_set_header Host $server_name ;
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP 127.0.0.1 ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment