Nginx https redirect issue

For example,
old url is http: //domain/my-url
new url is https://domain/my-url;

but when i view http: //domain/my-url , it will redirect to https://domain/? . the right result should be https: //domain/my-url

How to fix it? thanks.

If I get this clearly, you want to redirect all http traffic to https in nginx?

@iHello

Did you setup the https redirect manually? bench setup nginx sets this up correctly if you’ve set ssl_certificate and ssl_certificate_key in site_config.json

@iHello

Did you setup the https redirect manually? bench setup nginx sets this up correctly if you’ve set ssl_certificate and ssl_certificate_key in site_config.json

I use bench to setup nginx.
already set ssl_certificate and ssl_certificate_key in site_config.json ;
the issue is it can redirect http->https; but it cann’t redirect to the right url.

Yes. i use bench to setup nginx. and i want all http traffic to https

I fixed this issue now.

edit line70
replace:

          return 301 https://$host$request_uri?$query_string;

with

rewrite ^ https://$server_name$request_uri? permanent;

if you have access to the erpnext project’s code. you can contrib it.

i’m facing the same issue where the http traffic is not getting redirected to https.

i tried this solution and still facing the issue.

is there anything else to do on top of this?

note: i did manually install the certs via certbot certonly --standalone and then link the certs by following this frappe documentation

@anand @iHello