Всё работает
-Доктор, посмотрите на мой член!
-член как член...
-Нет, доктор, вы посмотрите какой красавец!!!
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
include /etc/nginx/sites-enabled/*;
непонятно зачемКак полностью отвязать путь от файловой системы?
http {
pagespeed On;
pagespeed FileCachePath "/var/cache/ngx_pagespeed/";
pagespeed EnableFilters combine_css,combine_javascript;
server {
listen 80;
server_name www.example1.com;
root /www/example1;
pagespeed MapRewriteDomain cdn.example1.com *example.com;
}
server {
listen 80;
server_name www.example2.org;
root /www/example2;
pagespeed MapRewriteDomain cdn.example2.org *example.org;
# Don't want combine_css here
pagespeed DisableFilters combine_css;
}
server {
listen 80;
server_name www.example3.org;
root /www/example3;
# mod_pagespeed off for this virtual host
pagespeed off;
}
Чисто теоретически возможно ли средствами nginx сделать что то подобное?
upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # взаимодействие с uwsgi через Unix-сокет (мы воспользуемся этим вариантом позже)
server 127.0.0.1:8001; # взаимодействие с uwsgi через веб-порт
}
location / {
try_files $uri /static/$uri @django_uwsgi;
}
location django_uwsgi {
uwsgi_pass django;
include uwsgi_params;
}
[uwsgi]
chdir=ПУТЬ_К_РУТУ_ПРОЕКТА
virtualenv=ПУТЬ_К_ВИРТЕНВ_ДИРЕКТОРИИ
module=НАЗВАНИЕ_ПРОЕКТА.wsgi:application
master=True
processes=КОЛЛИЧЕСТВО_ТРЕДОВ
vacuum=True
daemonize=ПУТЬ_К_ЛОГУ
socket=ПУТЬ_К_СОКЕТУ
chmod-socket = 666
processes=128
server
{
listen 80;
server_name a.com b.com c.com;
location ~* ^/comment/(.*) {
proxy_set_header HOST shared.com;
# $1 - stores capture from the location on top
# $is_args will return ? if there are query params
# $args stores query params
proxy_pass http://comment/$1$is_args$args;
}
}
server {
listen 80;
server shared.com;
location / {
# Proxy to some app handler
}
}
upstream comment {
server localhost; # or any other host essentially
}