Skip to content

Instantly share code, notes, and snippets.

@foursixnine
Forked from foxxyz/nginx.conf
Last active July 30, 2020 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foursixnine/f1e67561ca0c976b156cabc8042a1454 to your computer and use it in GitHub Desktop.
Save foursixnine/f1e67561ca0c976b156cabc8042a1454 to your computer and use it in GitHub Desktop.
Serve react app from current directory via nginx
# Extremely basic development setup to serve the current directory at http://localhost:9001
# Start nginx in this directory with `nginx -p . -c nginx.conf`
# Stop nginx with `nginx -p . -s stop`
# for opensuse: if running as a user, after running yarn build: `/usr/sbin/nginx -p . -c nginx.conf`
events {}
http {
# Serve files with correct mimetypes on OSX
# location may have to be adjusted depending on your OS and nginx install
include /usr/local/etc/nginx/mime.types;
server {# Extremely basic development setup to serve the current directory at http://localhost:9001
# Start nginx in this directory with `nginx -p . -c nginx.conf`
# Stop nginx with `nginx -p . -s stop`
events {}
http {
# Serve files with correct mimetypes on OSX
# location may have to be adjusted depending on your OS and nginx install
include /etc/nginx/mime.types;
server {
listen 9001;
access_log ./http.access.log;
error_log ./http.error.log;
root ./build;
index index.html index.htm;
autoindex on;
location / {
}
}
}
listen 9001;
access_log http.access.log;
error_log http.error.log;
root .;
location / {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment