Skip to content

This image replaces the Nginx `default.conf` file in order to correctly serve a SPA with routing.

Notifications You must be signed in to change notification settings

borisbelmar/nginx-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nginx React Ready

This image replaces the Nginx default.conf file in order to correctly serve a SPA with routing. Is based on Romain Cauquil's publication "How to use react-router with Nginx and Docker".

Usage

Just put your built project on /usr/share/nginx/html

This is an example using docker-compose and nginx-proxy.

react-app:
  image: borisbelmar/nginx-react:latest
  expose:
    - "80"
  volumes:
    - /home/user/react-app/build:/usr/share/nginx/html:ro
  environment:
    - VIRTUAL_HOST=my-domain.com
    - LETSENCRYPT_HOST=my-domain.com
    - LETSENCRYPT_EMAIL=user@my-domain.com

About

This image replaces the Nginx `default.conf` file in order to correctly serve a SPA with routing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published