mendix / m2ee-tools

m2ee, the Mendix runtime helper tools for GNU/Linux
Other
27 stars 40 forks source link

How do I redirect to HTTPS? #49

Closed eddideku closed 4 years ago

eddideku commented 4 years ago

Hello,

Using m2ee, I am not sure how to force https. I have current traffic automatically connecting to http. Is there a way to set it up that any requests to http redirects to https?

I currently have a developer attempting to test REST from one server to another and his application is connecting to http port even though his configuration is pointed at https.

hvisage commented 4 years ago

You will have to force/do it in the NGINX/etc. that fronts the Mendix… easiest/best place to do it

On 12 Sep 2019, at 18:25 , NVMeÐÐi notifications@github.com wrote:

Hello,

Using m2ee, I am not sure how to force https. I have current traffic automatically connecting to http. Is there a way to set it up that any requests to http redirects to https?

I currently have a developer attempting to test REST from one server to another and his application is connecting to http port even though his configuration is pointed at https.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mendix/m2ee-tools/issues/49?email_source=notifications&email_token=ACY7KSLR4WEWWQT7ZI72FADQJJUOFA5CNFSM4IWGZHEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HLBF4AQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ACY7KSNL4FK7RDNQ4VUOIWLQJJUOFANCNFSM4IWGZHEA.

eddideku commented 4 years ago

You will have to force/do it in the NGINX/etc. that fronts the Mendix… easiest/best place to do it On 12 Sep 2019, at 18:25 , NVMeÐÐi @.***> wrote: Hello, Using m2ee, I am not sure how to force https. I have current traffic automatically connecting to http. Is there a way to set it up that any requests to http redirects to https? I currently have a developer attempting to test REST from one server to another and his application is connecting to http port even though his configuration is pointed at https. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#49?email_source=notifications&email_token=ACY7KSLR4WEWWQT7ZI72FADQJJUOFA5CNFSM4IWGZHEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HLBF4AQ>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACY7KSNL4FK7RDNQ4VUOIWLQJJUOFANCNFSM4IWGZHEA.

Thank you! This is what I did in my nginx config file

/etc/nginx/conf.d/mendix.conf

I commented out the 2 lines for port 80 and added this block above the server{} block

`server { listen 80; listen [::]:80; server_name mytestserver.com; return 301 https://mytestserver.com$request_uri; }```