A
A
Andrey Mikhalev2016-09-19 08:54:17
Nginx
Andrey Mikhalev, 2016-09-19 08:54:17

How to convert all requests to https in nginx?

There is a forum, nginx - frontend, apache2 - backend.
https is configured, and problems arise when users add images from third-party sources - the browser swears at mixed content, and puts an exclamation mark next to the padlock.
Question: is it possible to configure nginx in such a way that all http connections are proxied and issued to the client via https?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Mikhalev, 2017-02-15
@Endru9

In general, the solution is banal, using sub_filter to change all links to https.

A
Alexey Ukolov, 2016-09-19
@alexey-m-ukolov

is it possible to configure nginx in such a way that all http connections are proxied and issued to the client via https?
Image requests from third-party sources do not reach your site, so no, proxying only using nginx will not work. You need to replace all links to external images with your handler, which will already handle proxying.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question