Skip to content

Commit

Permalink
Merge pull request #1275 from qhartman/master
Browse files Browse the repository at this point in the history
[nginx] Add support for simple redirector mode
  • Loading branch information
nellshamrell committed Mar 28, 2018
2 parents 48f1409 + a846b95 commit 590a8b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nginx/config/nginx.conf
Expand Up @@ -22,13 +22,21 @@ http {
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";

{{#if cfg.redirector ~}}
server {
listen {{cfg.http.listen.port}} default_server;
listen [::]:{{cfg.http.listen.port}} default_server;
server_name _;
return 301 https://$host$request_uri;
}
{{else}}
server {
listen {{cfg.http.listen.port}};
server_name localhost;

location / {
root {{pkg.svc_data_path}};
index index.html index.htm;
}
}
{{/if ~}}
}
3 changes: 3 additions & 0 deletions nginx/default.toml
Expand Up @@ -8,7 +8,10 @@
# refer to: http://nginx.org/en/docs/http/ngx_http_core_module.html



#### General Configuration
# redirector: If set, bypass normal config and just redirect http to https
# redirector = true
# worker_processes: Number of NGINX processes. Default = 1
worker_processes = 4

Expand Down

0 comments on commit 590a8b5

Please sign in to comment.