Configure nginx default vhost, add specific redirects for some domains #565

Merged
raucao merged 3 commits from chore/nginx_redirects into master 2024-08-09 12:44:30 +00:00
2 changed files with 29 additions and 2 deletions
Showing only changes of commit d53ba42a1d - Show all commits

View File

@ -0,0 +1,18 @@
# Generated by Chef
server {
server_name <%= @domain %>;
listen <%= "#{node['openresty']['listen_ip']}:" if node['openresty']['listen_ip'] %>443 ssl http2;
listen [::]:443 ssl http2;
root /var/www/<%= @domain %>/public;
access_log <%= node[:openresty][:log_dir] %>/<%= @domain %>.access.log;
error_log <%= node[:openresty][:log_dir] %>/<%= @domain %>.error.log warn;
gzip_static on;
gzip_comp_level 5;
ssl_certificate <%= @ssl_cert %>;
ssl_certificate_key <%= @ssl_key %>;
}

View File

@ -1,9 +1,18 @@
# Generated by Chef
server {
server_name _;
listen 80 default_server;
location / {
return 301 https://<%= @domain %>;
}
}
server {
server_name <%= @domain %>;
listen <%= "#{node['openresty']['listen_ip']}:" if node['openresty']['listen_ip'] %>443 ssl http2;
listen [::]:443 ssl http2;
listen <%= "#{node['openresty']['listen_ip']}:" if node['openresty']['listen_ip'] %>443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /var/www/<%= @domain %>/public;