https://github.com/chinchalinchin/nginx-angular-starter
An nginx container configured to serve an Angular 11 project.
https://github.com/chinchalinchin/nginx-angular-starter
Last synced: about 2 months ago
JSON representation
An nginx container configured to serve an Angular 11 project.
- Host: GitHub
- URL: https://github.com/chinchalinchin/nginx-angular-starter
- Owner: chinchalinchin
- Created: 2021-02-22T13:18:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-04T18:59:01.000Z (over 2 years ago)
- Last Synced: 2025-06-22T13:06:59.997Z (4 months ago)
- Language: HTML
- Size: 953 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nginx-angular-starter
An nginx container configured to serve Angular 11 and proxy requests to the a backend container.
## Quickstart
Copy .sample.env into container.env
> cp .sample.env container.env
Invoke build-container.sh shell script. From the root directory,
> ./scripts/build-container.sh
This will bring up an nginx server on localhost:8080. You can adjust the port the server runs on by changing the NGINX_PORT environment variable in the container.env file.
If you have the wrapper server running, enable the PROXY variable to tell nginx to proxy requests to the backend. Be sure to configure the PROXY_HOST and PROXY_PORT variables accordingly. See .sample.env comments for more information.
# Notes
1. If you get the following error when starting up the container `$'\r': command not found`, this is due to the line endings in the either the /scripts/bootstrap.sh or /scripts/util/logging.sh shell script. Use the /scripts/util/unixify.sh shell script to traverse the project directory and change all line endings to Unix-style,
> ./scripts/util/unixify.sh "$(pwd)"
I recommend deleting the /frontend/node_modules/ directory before doing this, as the traversal will take some time if node_modules is included in its search path.
## nginx Documentation
- [nginx Beginner's Guide](https://nginx.org/en/docs/beginners_guide.html)
- [nginx Docker Hub](https://hub.docker.com/_/nginx)
- [nginx Github](https://github.com/nginxinc/docker-nginx)
- [nginx HTTP Core Module Variables](http://nginx.org/en/docs/http/ngx_http_core_module.html#variables)
- [nginx HTTP Headers Module](http://nginx.org/en/docs/http/ngx_http_headers_module.html)
- [nginx Example Config](https://www.nginx.com/nginx-wiki/build/dirhtml/start/topics/examples/full/)
- [nginx try_files](http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files)## nginx Tutorials
- [Serve Angular App on nginx Server](https://thatisuday.medium.com/serving-angular-app-on-nginx-server-7656166c2f1c)
- [nginx Font Face Formats](https://serverfault.com/questions/186965/how-can-i-make-nginx-support-font-face-formats-and-allow-access-control-allow-o)
- [nginx Font Rules](https://www.linode.com/community/questions/16980/nginx-font-rules)
- [nginx CORS](https://serverfault.com/questions/162429/how-do-i-add-access-control-allow-origin-in-nginx)## Stack Overflows
- [Run nginx With Custom Config](https://stackoverflow.com/questions/30151436/how-to-run-nginx-docker-container-with-custom-config)
- [No Events Section in Configuration](https://stackoverflow.com/questions/54481423/nginx-startup-prompt-emerg-no-events-section-in-configuration)