Last active
March 31, 2023 07:53
-
-
Save skolhustick/dcbec823ad78c43380112d3136e028cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
#ONE FOR EACH NEXTJS APP AND SUBDOMAIN | |
#BIKES - PORT 3001 | |
location /bikes/_next/static { | |
autoindex on; | |
alias /home/ubuntu/bikes/.next/static; | |
} | |
location /bikes/api { | |
proxy_pass http://localhost:3001/api; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host;proxy_cache_bypass $http_upgrade; | |
} | |
location /bikes { | |
proxy_pass http://localhost:3001; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
#CARS - PORT 3002 | |
location /cars/_next/static { | |
autoindex on; | |
alias /home/ubuntu/cars/.next/static; | |
} | |
location /cars/api { | |
proxy_pass http://localhost:3002/api; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host;proxy_cache_bypass $http_upgrade; | |
} | |
location /cars { | |
proxy_pass http://localhost:3002; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
#TRUCKS - PORT 3003 | |
location /trucks/_next/static { | |
autoindex on; | |
alias /home/ubuntu/trucks/.next/static; | |
} | |
location /trucks/api { | |
proxy_pass http://localhost:3003/api; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host;proxy_cache_bypass $http_upgrade; | |
} | |
location /trucks { | |
proxy_pass http://localhost:3003; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What about static images from the NextJS?