Skip to content

Instantly share code, notes, and snippets.

@tieppt
Created June 2, 2020 05:22

Revisions

  1. tieppt created this gist Jun 2, 2020.
    36 changes: 36 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    server {
    ## port
    listen 80;
    ## Your website name goes here.
    server_name example.com;

    ## Your only path reference.
    root /var/www/example.com/public_html;

    ## This should be in your http block and if it is, it's not needed here.
    index index.html;

    autoindex off;

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

    location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
    }

    location / {
    if (!-e $request_filename){
    rewrite ^(.*)$ /index.html break;
    }
    }

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