Skip to content

Instantly share code, notes, and snippets.

@lorainwings
Created January 8, 2020 10:00
Show Gist options
  • Save lorainwings/b2f4a7b1a8bb2944666fab6ca3ad1ad5 to your computer and use it in GitHub Desktop.
Save lorainwings/b2f4a7b1a8bb2944666fab6ca3ad1ad5 to your computer and use it in GitHub Desktop.

Revisions

  1. lorainwings revised this gist Jan 8, 2020. No changes.
  2. lorainwings created this gist Jan 8, 2020.
    26 changes: 26 additions & 0 deletions nginx mulitple pages
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    location ~ /(.*)/detail {

    set $first_path $1;

    root /home/www/growth-upgrade/html;
    try_files $uri $uri/ $first_path/index.html;

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


    location ~ /(.*)/(.*) {
    set $first_path $1;
    set $following_path $2;

    root /home/www/growth-upgrade/html;
    try_files $uri $uri/ $first_path/index.html;

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