I
I
ilovebu2015-02-09 20:34:25
MySQL
ilovebu, 2015-02-09 20:34:25

How to setup nginx+apache+mysql?

You need to configure a web server on Linux so that requests starting with: site.ru/pict to return images (in this case, images
are files with the extension .jpg and .png)
are processed by Nginx, and all the rest are transferred to Apache2 for processing , while all such requests that Nginx was supposed to, but for some reason could not process on its own - should be transmitted to Apache2 (i.e., if there is no site.ru/pict/1.jpg file and Nginx, of course, cannot serve such a file, then such requests should be passed to Apache2 for processing).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Gerasenkov, 2015-02-10
@m000dy

then just type in a specific location, indicating the types + proxy_pass on the backend)
something like this, if I'm not mistaken.

location ~ ^.+\.(jpg|jpeg|gif|png|js)$ {
        root /catalog_saita/;
        access_log off;
        expires 3d;
ниже пересылка на бэкэнд и кэш, для его разгрузки
        proxy_pass         $proxyserver;

        proxy_cache_valid  60m;
        proxy_redirect     off;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_cache_key    $scheme$proxy_host$request_uri$host;

N
Nazar Mokrinsky, 2015-02-10
@nazarpc

If you are setting it up for the first time, it is probably better for you not to fence Apache2.
What do you hang up on Apache2, what language do you use?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question