Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

nginx docker redirect no trailing slash to trailing slash

server {
    listen 80;
    listen 443 ssl http2;
    
    ...

    # This is the line that redirects uris with missing / (it adds it to the uri)
    rewrite ^/repairapp/([^static].*[^/])$ /repairapp/$1/ permanent;
    
    # This is nginx serving my static files
    location /repairapp/static/ {
        alias /var/www/repairapp/static/;
    }
    
    # This is the uri that maps to my app (no file serving here)
    location /repairapp/ {
        proxy_pass http://repairappcontainer:8000/;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
    }
    
    ...
Comment

PREVIOUS NEXT
Code Example
Shell :: how to add ca to linux 
Shell :: create necxt app 
Shell :: install minipyer 
Shell :: apt NO_PUBKEY 23E7166788B63E1E 
Shell :: WSL2 trying to launch VSCode with code . results in error "Please install missing certificates." 
Shell :: how to make ubuntu automatic updates 
Shell :: open .bashrc 
Shell :: current directory in batch file 
Shell :: ffmpeg convert directory 
Shell :: update ruby version 
Shell :: where is the mpv config file linux 
Shell :: mass uninstall packages django 
Shell :: aws security groups vs ufw 
Shell :: use x2go with gnome linux 
Shell :: discord on linux 
Shell :: undo git merge 
Shell :: install tar.xz on ubuntu 
Shell :: downooad sublime in linux mint using terminal 
Shell :: check ram speed 
Shell :: git stash unstaged 
Shell :: git create new branch from existing branch 
Shell :: libxml2 install 
Shell :: get all the branch in git 
Shell :: firebase deploy command 
Shell :: install sanity global cli 
Shell :: whybar not showing icons 
Shell :: how to install figma for linux 
Shell :: Install Sublime in Linux (Stable) 
Shell :: add directory to path windows 10 
Shell :: recursively remove files with extension linux 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =