301 on http

This commit is contained in:
Primakov Alexandr Alexandrovich 2022-01-11 19:40:36 +03:00
parent f87c278fcd
commit ef56ba2f09

33
80.conf
View File

@ -1,9 +1,30 @@
# server { server {
# listen 80; listen 80;
# server_name inno-js.ru; listen [::]:80;
# # index index.php index.html index.htm index.nginx-debian.html;
# include "parts/api-multystub.conf"; server_name ~^(?<subdomain>.+)\.inno-js\.ru$;
if ($subdomain = "") {
return 301 https://inno-js.ru$request_uri;
}
return 301 https://$subdomain.inno-js.ru$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ^inno-js\.ru$;
index index.php index.html index.htm index.nginx-debian.html;
ssl_certificate /etc/letsencrypt/live/inno-js.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/inno-js.ru/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/inno-js.ru/chain.pem;
include "parts/api-multystub.conf";
root "/var/www/html";
# location / { # location / {
# add_header 'Access-Control-Allow-Origin' '*'; # add_header 'Access-Control-Allow-Origin' '*';
@ -12,7 +33,7 @@
# add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; # add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
# proxy_pass http://212.193.59.173:8079/; # proxy_pass http://212.193.59.173:8079/;
# } # }
# } }
server { server {
# listen 80; # listen 80;