Skip to content

Instantly share code, notes, and snippets.

@hwdsl2
Last active July 25, 2023 09:18
Show Gist options
  • Save hwdsl2/801f73fdd6c032b7539c to your computer and use it in GitHub Desktop.
Save hwdsl2/801f73fdd6c032b7539c to your computer and use it in GitHub Desktop.

Revisions

  1. hwdsl2 revised this gist Sep 21, 2016. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -53,12 +53,13 @@ http {
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }

    # Comment out if you wish to use files generated by Ghost blog
    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    log_not_found off;
    }
    # Uncomment this block if you wish to use your own files
    # instead of those auto-generated by Ghost blog
    # location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    # root /var/www/YOUR.DOMAIN.NAME/public;
    # access_log off;
    # log_not_found off;
    # }

    # Static files served directly by Nginx
    location ~ ^/assets/(img|js|css|fonts)/ {
  2. hwdsl2 revised this gist Sep 19, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -100,7 +100,7 @@ http {
    proxy_http_version 1.1;
    proxy_cache one;
    proxy_cache_key "$scheme$host$request_uri";
    proxy_cache_valid 200 302 10m;
    proxy_cache_valid 200 10m;
    proxy_cache_valid 404 1m;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    proxy_intercept_errors on;
  3. hwdsl2 revised this gist Apr 26, 2016. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -28,12 +28,12 @@ http {
    server 127.0.0.1:2368;
    keepalive 64;
    }

    server {
    listen 80 default_server;
    listen 443 default_server ssl;
    listen 80;
    listen 443 ssl;
    server_name YOUR.DOMAIN.NAME;

    ssl_certificate /opt/nginx/conf/ssl-unified.crt;
    ssl_certificate_key /opt/nginx/conf/YOUR.DOMAIN.NAME.pem;

    @@ -53,6 +53,7 @@ http {
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }

    # Comment out if you wish to use files generated by Ghost blog
    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    @@ -65,18 +66,18 @@ http {
    expires 30d;
    access_log off;
    }

    location ~ ^/(img/|css/|lib/|vendor/|fonts/) {
    root /var/www/YOUR.DOMAIN.NAME/core/client/assets;
    expires 30d;
    access_log off;
    }
    }

    location ~ ^/content/images/ {
    root /var/www/YOUR.DOMAIN.NAME;
    expires 30d;
    access_log off;
    }
    }

    location ~ ^/(shared/|built/) {
    root /var/www/YOUR.DOMAIN.NAME/core;
    @@ -110,4 +111,4 @@ http {
    #error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    }
    }
    }
  4. hwdsl2 revised this gist Apr 19, 2016. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -83,12 +83,6 @@ http {
    expires 30d;
    access_log off;
    }

    location ~ ^/public/ {
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    expires 30d;
    access_log off;
    }

    location / {

  5. hwdsl2 revised this gist Feb 1, 2016. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -37,10 +37,8 @@ http {
    ssl_certificate /opt/nginx/conf/ssl-unified.crt;
    ssl_certificate_key /opt/nginx/conf/YOUR.DOMAIN.NAME.pem;

    # Due to the SSLv3 POODLE vulnerability, it is recommended to use
    # the 2nd configuration below which disables SSLv3.
    # ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 ref: POODLE
    # Due to the SSLv3 POODLE vulnerability, it is excluded from the protocol list.
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers RC4:HIGH:!MEDIUM:!aNULL:!MD5:!DH:!EDH;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
  6. hwdsl2 revised this gist Jan 12, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -107,10 +107,14 @@ http {
    proxy_http_version 1.1;
    proxy_cache one;
    proxy_cache_key "$scheme$host$request_uri";
    proxy_cache_valid 200 302 10m;
    proxy_cache_valid 404 1m;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    proxy_intercept_errors on;
    proxy_hide_header X-Powered-By;
    }

    location = /50x.html { root html; }
    location = /50x.html { root html; internal; }
    #error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    }
  7. hwdsl2 revised this gist Dec 21, 2015. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,3 @@
    # Example nginx.conf for Ghost blog (https://ghost.org) with Nginx and ModSecurity WAF.
    # For detailed instructions, please see:
    # https://blog.ls20.com/install-ghost-0-3-3-with-nginx-and-modsecurity/

    user nginx;
    worker_processes 2; # Set this equal to the number of CPU cores
    events { worker_connections 1024; }
  8. hwdsl2 revised this gist Dec 15, 2015. 1 changed file with 7 additions and 21 deletions.
    28 changes: 7 additions & 21 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,4 @@
    # Example nginx.conf for Ghost blog (https://ghost.org) with Nginx
    # as a reverse proxy and the ModSecurity web application firewall.
    #
    # Example nginx.conf for Ghost blog (https://ghost.org) with Nginx and ModSecurity WAF.
    # For detailed instructions, please see:
    # https://blog.ls20.com/install-ghost-0-3-3-with-nginx-and-modsecurity/

    @@ -26,7 +24,10 @@ http {
    proxy_temp_path /var/tmp;
    client_max_body_size 20m;
    client_body_buffer_size 128k;


    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;

    upstream ghost_upstream {
    server 127.0.0.1:2368;
    keepalive 64;
    @@ -59,59 +60,44 @@ http {
    location ~ ~$ { deny all; }

    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    log_not_found off;
    }

    # Static files served directly by Nginx
    location ~ ^/assets/(img|js|css|fonts)/ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/content/themes/casper;
    expires 30d;
    access_log off;
    }

    location ~ ^/(img/|css/|lib/|vendor/|fonts/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/client/assets;
    expires 30d;
    access_log off;
    }

    location ~ ^/(content/images/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    location ~ ^/content/images/ {
    root /var/www/YOUR.DOMAIN.NAME;
    expires 30d;
    access_log off;
    }

    location ~ ^/(shared/|built/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core;
    expires 30d;
    access_log off;
    }

    location ~ ^/public/ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    expires 30d;
    access_log off;
    }

    location / {

    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;


    proxy_pass http://ghost_upstream;
    proxy_redirect off;
    proxy_read_timeout 180s;
  9. hwdsl2 revised this gist May 31, 2015. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,10 @@ http {
    ssl_certificate /opt/nginx/conf/ssl-unified.crt;
    ssl_certificate_key /opt/nginx/conf/YOUR.DOMAIN.NAME.pem;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    # Due to the SSLv3 POODLE vulnerability, it is recommended to use
    # the 2nd configuration below which disables SSLv3.
    # ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 ref: POODLE
    ssl_ciphers RC4:HIGH:!MEDIUM:!aNULL:!MD5:!DH:!EDH;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
  10. hwdsl2 revised this gist May 30, 2015. 1 changed file with 4 additions and 6 deletions.
    10 changes: 4 additions & 6 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -5,18 +5,16 @@
    # https://blog.ls20.com/install-ghost-0-3-3-with-nginx-and-modsecurity/

    user nginx;
    worker_processes 1; # Set this equal to the number of CPU cores
    worker_processes 2; # Set this equal to the number of CPU cores
    events { worker_connections 1024; }
    http {
    server_names_hash_bucket_size 64;
    types_hash_max_size 2048;
    server_tokens off;
    include mime.types;
    default_type application/octet-stream;
    add_header X-Frame-Options SAMEORIGIN; # May prevent StumbleUpon from working
    add_header X-Content-Type-Options nosniff;
    sendfile on;
    keepalive_timeout 10;
    keepalive_timeout 15;
    gzip on;
    gzip_comp_level 6;
    gzip_disable "msie6";
    @@ -41,7 +39,8 @@ http {

    ssl_certificate /opt/nginx/conf/ssl-unified.crt;
    ssl_certificate_key /opt/nginx/conf/YOUR.DOMAIN.NAME.pem;
    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers RC4:HIGH:!MEDIUM:!aNULL:!MD5:!DH:!EDH;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    @@ -53,7 +52,6 @@ http {
    }

    location ~* \.(db|hbs|conf)$ { deny all; }
    location ~ /\.ht { deny all; }
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }

  11. hwdsl2 revised this gist May 12, 2014. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    # Example nginx.conf for Ghost blog (https://ghost.org) with Nginx
    # as a reverse proxy and the ModSecurity web application firewall.
    #
    # For detailed instructions, please see:
    # https://blog.ls20.com/install-ghost-0-3-3-with-nginx-and-modsecurity/

    user nginx;
    worker_processes 1; # Set this equal to the number of CPU cores
    events { worker_connections 1024; }
  12. hwdsl2 revised this gist May 4, 2014. 1 changed file with 69 additions and 69 deletions.
    138 changes: 69 additions & 69 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -46,83 +46,83 @@ http {
    return 301 $scheme://$server_name$request_uri;
    }

    location ~* \.(db|hbs|conf)$ { deny all; }
    location ~ /\.ht { deny all; }
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }
    location ~* \.(db|hbs|conf)$ { deny all; }
    location ~ /\.ht { deny all; }
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }

    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    log_not_found off;
    }
    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    log_not_found off;
    }

    # Static files served directly by Nginx
    location ~ ^/assets/(img|js|css|fonts)/ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/content/themes/casper;
    expires 30d;
    access_log off;
    }
    # Static files served directly by Nginx
    location ~ ^/assets/(img|js|css|fonts)/ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/content/themes/casper;
    expires 30d;
    access_log off;
    }

    location ~ ^/(img/|css/|lib/|vendor/|fonts/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/client/assets;
    expires 30d;
    access_log off;
    }
    location ~ ^/(img/|css/|lib/|vendor/|fonts/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/client/assets;
    expires 30d;
    access_log off;
    }

    location ~ ^/(content/images/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME;
    expires 30d;
    access_log off;
    }
    location ~ ^/(content/images/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME;
    expires 30d;
    access_log off;
    }

    location ~ ^/(shared/|built/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core;
    expires 30d;
    access_log off;
    }
    location ~ ^/(shared/|built/) {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core;
    expires 30d;
    access_log off;
    }

    location ~ ^/public/ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    expires 30d;
    access_log off;
    }
    location ~ ^/public/ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    expires 30d;
    access_log off;
    }

    location / {
    location / {

    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;

    proxy_pass http://ghost_upstream;
    proxy_redirect off;
    proxy_read_timeout 180s;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_set_header Connection "";
    proxy_pass_header X-CSRF-TOKEN;
    proxy_http_version 1.1;
    proxy_cache one;
    proxy_cache_key "$scheme$host$request_uri";
    proxy_hide_header X-Powered-By;
    }
    proxy_pass http://ghost_upstream;
    proxy_redirect off;
    proxy_read_timeout 180s;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_set_header Connection "";
    proxy_pass_header X-CSRF-TOKEN;
    proxy_http_version 1.1;
    proxy_cache one;
    proxy_cache_key "$scheme$host$request_uri";
    proxy_hide_header X-Powered-By;
    }

    location = /50x.html { root html; }
    #error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    }
    location = /50x.html { root html; }
    #error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    }
    }
  13. hwdsl2 revised this gist May 3, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ http {
    }

    server {
    listen 80;
    listen 80 default_server;
    listen 443 default_server ssl;
    server_name YOUR.DOMAIN.NAME;

  14. hwdsl2 revised this gist Apr 21, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ http {
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;

    if ($request_method !~ ^(GET|HEAD|POST|PUT)$ ) { return 444; }
    if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE)$ ) { return 444; }
    if ($host != $server_name) {
    return 301 $scheme://$server_name$request_uri;
    }
  15. hwdsl2 revised this gist Apr 12, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ http {
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;

    if ($request_method !~ ^(GET|HEAD|POST)$ ) { return 444; }
    if ($request_method !~ ^(GET|HEAD|POST|PUT)$ ) { return 444; }
    if ($host != $server_name) {
    return 301 $scheme://$server_name$request_uri;
    }
  16. hwdsl2 revised this gist Apr 11, 2014. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    worker_processes 2; # Set this equal to the number of CPU cores
    events {
    worker_connections 768;
    }
    user nginx;
    worker_processes 1; # Set this equal to the number of CPU cores
    events { worker_connections 1024; }
    http {
    server_names_hash_bucket_size 64;
    types_hash_max_size 2048;
  17. hwdsl2 revised this gist Apr 9, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -53,6 +53,8 @@ http {
    location ~ ~$ { deny all; }

    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    log_not_found off;
  18. hwdsl2 revised this gist Apr 7, 2014. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -60,41 +60,41 @@ http {

    # Static files served directly by Nginx
    location ~ ^/assets/(img|js|css|fonts)/ {
    root /var/www/YOUR.DOMAIN.NAME/content/themes/casper;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/content/themes/casper;
    expires 30d;
    access_log off;
    }

    location ~ ^/(img/|css/|lib/|vendor/|fonts/) {
    root /var/www/YOUR.DOMAIN.NAME/core/client/assets;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/client/assets;
    expires 30d;
    access_log off;
    }

    location ~ ^/(content/images/) {
    root /var/www/YOUR.DOMAIN.NAME;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME;
    expires 30d;
    access_log off;
    }

    location ~ ^/(shared/|built/) {
    root /var/www/YOUR.DOMAIN.NAME/core;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core;
    expires 30d;
    access_log off;
    }

    location ~ ^/public/ {
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    ModSecurityConfig modsecurity.conf;
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    expires 30d;
    access_log off;
    }
  19. hwdsl2 revised this gist Apr 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ http {

    server {
    listen 80;
    listen 443 default_server ssl spdy;
    listen 443 default_server ssl;
    server_name YOUR.DOMAIN.NAME;

    ssl_certificate /opt/nginx/conf/ssl-unified.crt;
  20. hwdsl2 revised this gist Apr 7, 2014. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -52,9 +52,6 @@ http {
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }

    location ~ ^/signout/ { deny all; }
    location ~ ^/ghost/ { deny all; }

    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
  21. hwdsl2 revised this gist Apr 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ http {

    server {
    listen 80;
    listen 443 default ssl;
    listen 443 default_server ssl spdy;
    server_name YOUR.DOMAIN.NAME;

    ssl_certificate /opt/nginx/conf/ssl-unified.crt;
  22. hwdsl2 revised this gist Apr 5, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -62,7 +62,7 @@ http {
    }

    # Static files served directly by Nginx
    location ~ ^/assets/(images|js|css|fonts)/ {
    location ~ ^/assets/(img|js|css|fonts)/ {
    root /var/www/YOUR.DOMAIN.NAME/content/themes/casper;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
  23. hwdsl2 revised this gist Apr 5, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -52,6 +52,9 @@ http {
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }

    location ~ ^/signout/ { deny all; }
    location ~ ^/ghost/ { deny all; }

    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    @@ -99,9 +102,6 @@ http {
    access_log off;
    }

    location ~ ^/signout/ { deny all; }
    location ~ ^/ghost/ { deny all; }

    location / {

    ModSecurityEnabled on;
  24. hwdsl2 revised this gist Apr 5, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ http {

    # Static files served directly by Nginx
    location ~ ^/assets/(images|js|css|fonts)/ {
    root /var/www/YOUR.DOMAIN.NAME/content/themes/YOUR_THEME;
    root /var/www/YOUR.DOMAIN.NAME/content/themes/casper;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    expires 30d;
  25. hwdsl2 revised this gist Apr 5, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -103,8 +103,10 @@ http {
    location ~ ^/ghost/ { deny all; }

    location / {

    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;

    proxy_pass http://ghost_upstream;
    proxy_redirect off;
    proxy_read_timeout 180s;
  26. hwdsl2 revised this gist Apr 5, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -93,6 +93,8 @@ http {

    location ~ ^/public/ {
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    ModSecurityEnabled on;
    ModSecurityConfig modsecurity.conf;
    expires 30d;
    access_log off;
    }
  27. hwdsl2 renamed this gist Apr 5, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  28. hwdsl2 revised this gist Apr 5, 2014. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Ghost blog - Nginx config with ModSecurity
    Original file line number Diff line number Diff line change
    @@ -90,6 +90,12 @@ http {
    expires 30d;
    access_log off;
    }

    location ~ ^/public/ {
    root /var/www/YOUR.DOMAIN.NAME/core/built;
    expires 30d;
    access_log off;
    }

    location ~ ^/signout/ { deny all; }
    location ~ ^/ghost/ { deny all; }
  29. hwdsl2 revised this gist Feb 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Ghost blog - Nginx config with ModSecurity
    Original file line number Diff line number Diff line change
    @@ -52,7 +52,7 @@ http {
    location ~ /\. { deny all; }
    location ~ ~$ { deny all; }

    location ~ ^/(sitemap.xml|robots.txt|favicon.ico)$ {
    location ~ ^/(sitemap\.xml|robots\.txt|favicon\.ico)$ {
    root /var/www/YOUR.DOMAIN.NAME/public;
    access_log off;
    log_not_found off;
  30. hwdsl2 renamed this gist Jan 27, 2014. 1 changed file with 0 additions and 0 deletions.