Как Настроить редирект через nginx config?

на сайте exmaple.com настроен редирект на другой сайт, помогите пожалуйста разобраться мне нужно чтобы был редирект со всех вариаций урл

http://example.com/

https://example.com/

http://example.com:80/

https://example.com:80/

использую такой конфиг nginx:

server {
    server_name example.com www.example.com  ;

listen 99.99.99.99:80;
listen 99.99.99.99:443 ssl ;

ssl_certificate "/var/www/httpd-cert/example.com_2020-11-13-13-03_46.crt";
ssl_certificate_key "/var/www/httpd-cert/example.com_2020-11-13-13-03_46.key";

charset utf-8;
gzip on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/css text/xml application/javascript text/plain application/json image/svg+xml image/x-icon;
gzip_comp_level 1;

set $root_path /var/www/example.com/data/www/example.com;
root $root_path;
disable_symlinks if_not_owner from=$root_path;

location / {

    proxy_pass http://127.0.0.1:81;
    proxy_redirect http://127.0.0.1:81/ /;
    include /etc/nginx/proxy_params;
}


 location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2|rar|swf|ico|7z|doc|docx|map|ogg|otf|pdf|tff|tif|txt|wav|webp|woff|woff2|xls|xlsx|xml)$ {
    try_files $uri $uri/ @fallback;
}

location @fallback {
    proxy_pass http://127.0.0.1:81;
    proxy_redirect http://127.0.0.1:81/ /;
    include /etc/nginx/proxy_params;
}

include "/etc/nginx/fastpanel2-sites/example.com/example.com.includes";
include /etc/nginx/fastpanel2-includes/*.conf;
error_log /var/www/example.com/data/logs/example.com-frontend.error.log;
access_log /var/www/example.com/data/logs/example.com-frontend.access.log;

}

Работают все кроме последнего https://example.com:80/, не могу понять что я не так делаю?


Ответы (0 шт):