A
A
Anton Misyagin2017-10-07 10:01:12
Nginx
Anton Misyagin, 2017-10-07 10:01:12

How to make one site address available via http on Nginx?

Now that's how I'm set up. All http requests are directed to https:

server {
  listen *:80;
  server_name мой сайт;
  proxy_set_header Host мой сайт;
  location / {
    rewrite ^(.*)$ https://мой сайт$1 permanent;
  }
}


It is necessary for me that one (or a certain number) of addresses specifically-hard-coded in the config would not be redirected to https. I need this to automatically replace the site certificate

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Misyagin, 2017-10-07
@sunnmas

server {
listen *:80;
server_name site;
proxy_set_header Host site;
location ^~ /.well-known/acme-challenge/ {
allow all;
}
location / {
rewrite ^(.*)$ https://site$1 permanent;
}
root /myfolderpath/public;
}
Now you can renew ssl certificates without dancing with a tambourine

A
Andrey Burov, 2017-10-07
@BuriK666

make a separate server for them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question