skip to Main Content
0272 214 49 44 | 0532 588 01 01 | 0507 0099 007 | info@rinmedya.com

Reklam Forumlar Web Tasarım Nginx + Varnish Konfigürasyonu Over SSL

Bu konu 0 yanıt ve 1 izleyen içeriyor ve en son  Erdal Kaplan tarafından 1 yıl 10 ay önce tarihinde güncellendi.

1 yazı görüntüleniyor (toplam 1)
  • Yazar
    Yazılar
  • #12132

    Yönetici

    Nginx Conf ;

    ////*********

    server {
    listen 443 ssl;

    server_name rinmedya_turktiger;

    ssl_certificate /etc/ssl/rinmedya_turktiger/cert_chain.pem;
    ssl_certificate_key /etc/ssl/rinmedya_turktiger/key.pem;

    location / {
    # Pass the request on to Varnish.
    proxy_pass http://127.0.0.1;

    # Pass a bunch of headers to the downstream server, so they’ll know what’s going on.
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # Most web apps can be configured to read this header and understand that the current session is actually HTTPS.
    proxy_set_header X-Forwarded-Proto https;

    # We expect the downsteam servers to redirect to the right hostname, so don’t do any rewrites here.
    proxy_redirect off;
    }
    }

    ////*********

     

    Varnish Conf ;

    ////*********

    # List of upstream proxies we trust to set X-Forwarded-For correctly.
    acl upstream_proxy {
    “127.0.0.1”;
    }

    backend default {
    .host = “127.0.0.1”;
    .port = “8080”;
    }

    sub vcl_recv {
    # Set the X-Forwarded-For header so the backend can see the original
    # IP address. If one is already set by an upstream proxy, we’ll just re-use that.
    if (client.ip ~ upstream_proxy && req.http.X-Forwarded-For) {
    set req.http.X-Forwarded-For = req.http.X-Forwarded-For;
    } else {
    set req.http.X-Forwarded-For = regsub(client.ip, “:.*”, “”);
    }
    }

    sub vcl_hash {
    # URL and hostname/IP are the default components of the vcl_hash
    # implementation. We add more below.
    hash_data(req.url);
    if (req.http.host) {
    hash_data(req.http.host);
    } else {
    hash_data(server.ip);
    }

    # Include the X-Forward-Proto header, since we want to treat HTTPS
    # requests differently, and make sure this header is always passed
    # properly to the backend server.
    if (req.http.X-Forwarded-Proto) {
    hash_data(req.http.X-Forwarded-Proto);
    }

    return (hash);
    }

    ////*********

1 yazı görüntüleniyor (toplam 1)

Bu konuyu yanıtlamak için giriş yapmış olmalısınız.

×Close search
Ara