Refactored
This commit is contained in:
46
wo/cli/templates/virtualconf.mustache
Normal file
46
wo/cli/templates/virtualconf.mustache
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
server {
|
||||
|
||||
{{#multisite}}
|
||||
# Uncomment the following line for domain mapping
|
||||
# listen 80 default_server;
|
||||
{{/multisite}}
|
||||
|
||||
server_name {{^vma}}{{^rc}}{{site_name}}{{/rc}}{{/vma}} {{#vma}}vma.*{{/vma}} {{#rc}}webmail.*{{/rc}} {{^vma}}{{^rc}}{{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}{{/rc}}{{/vma}};
|
||||
|
||||
{{#multisite}}
|
||||
# Uncomment the following line for domain mapping
|
||||
#server_name_in_redirect off;
|
||||
{{/multisite}}
|
||||
|
||||
access_log /var/log/nginx/{{site_name}}.access.log {{^wpredis}}{{^static}}rt_cache{{/static}}{{/wpredis}}{{#wpredis}}rt_cache_redis{{/wpredis}};
|
||||
error_log /var/log/nginx/{{site_name}}.error.log;
|
||||
|
||||
{{#proxy}}
|
||||
add_header X-Proxy-Cache $upstream_cache_status;
|
||||
location / {
|
||||
proxy_pass http://{{host}}:{{port}};
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
{{/proxy}}
|
||||
|
||||
{{^proxy}}
|
||||
{{^vma}}{{^rc}}root {{webroot}}/htdocs;{{/rc}}{{/vma}}
|
||||
|
||||
{{^proxy}}index {{^static}}index.php{{/static}} index.html index.htm;{{/proxy}}
|
||||
|
||||
{{#static}}
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
{{/static}}
|
||||
|
||||
{{^static}}include {{^hhvm}}{{#basic}}common/php.conf;{{/basic}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}{{#wpredis}}common/redis.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
|
||||
{{#wp}}include common/wpcommon.conf;{{/wp}}
|
||||
{{^proxy}}include common/locations.conf;{{/proxy}}
|
||||
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
|
||||
{{/proxy}}
|
||||
}
|
||||
Reference in New Issue
Block a user