nginx – vhost configuration example

Here is my nginx – vhost configuration example:

server {
    listen 80;
    listen 443 ssl;

    server_name mattionline.de;
    access_log /var/log/nginx/blog_access.log combined;
    error_log  /var/log/nginx/blog_error.log;

    if ( $scheme = "http" ) {
        return 301 https://$server_name$request_uri;
    }

    root /var/www/blog/;
    index index.html index.htm index.php;

    ssl_certificate /etc/letsencrypt/live/mattionline.de/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mattionline.de/privkey.pem;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

    include hhvm.conf;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ {
                expires         30d;
                access_log      off;
                log_not_found   off;
    }

}

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Nach oben scrollen