Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. @kevindees kevindees revised this gist Dec 13, 2020. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions nginx-server-template.conf
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,12 @@
    server {
    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    ssl_certificate /usr/local/etc/nginx/ssl/{{host}}.crt;
    ssl_certificate_key /usr/local/etc/nginx/ssl/{{host}}.key;
    ssl_ciphers HIGH:!aNULL:!MD5;

    listen 80;
    # listen 80;
    server_name {{host}};
    root {{root}};

  2. @kevindees kevindees revised this gist Dec 11, 2020. 1 changed file with 12 additions and 3 deletions.
    15 changes: 12 additions & 3 deletions nginx-server-template.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,10 @@
    server {
    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    listen 80;
    server_name {{host}};
    root {{root}};

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    @@ -9,11 +13,13 @@ server {
    index index.html index.htm index.php;

    charset utf-8;

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt { access_log off; log_not_found off; }

    #access_log logs/host.access.log main;
    access_log off;

    location / {
    root {{root}};
    try_files $uri $uri/ /index.php?$query_string;
    }

    @@ -26,5 +32,8 @@ server {
    fastcgi_index index.php;
    include fastcgi_params;
    }


    location ~ /\.(?!well-known).* {
    deny all;
    }
    }
  3. @kevindees kevindees revised this gist Dec 11, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions nginx-server-template.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    server {
    listen 80;
    server_name localhost test.x;
    server_name {{host}};

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    @@ -13,7 +13,7 @@ server {
    #access_log logs/host.access.log main;

    location / {
    root html;
    root {{root}};
    try_files $uri $uri/ /index.php?$query_string;
    }

  4. @kevindees kevindees created this gist Dec 11, 2020.
    30 changes: 30 additions & 0 deletions nginx-server-template.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    server {
    listen 80;
    server_name localhost test.x;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

    #access_log logs/host.access.log main;

    location / {
    root html;
    try_files $uri $uri/ /index.php?$query_string;
    }

    error_page 404 /index.php;

    location ~ \.php$ {
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass 127.0.0.1:9074;
    fastcgi_index index.php;
    include fastcgi_params;
    }

    }