This is my nginx config:
server {
listen 80;
server_name example.com;
server_tokens off;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
proxy_pass http://frontend:4200;
# return 301 https://$host$request_uri;
}
location /api {
proxy_pass http://backend:8080;
rewrite ^/api/(.*) /$1 break;
}
}
How to creacte both: redirect to 301 https://$host$request_uri; and proxy_pass http://frontend:4200;
If uncomment this string # return 301 https://$host$request_uri; I see only redirect.