-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3e6af0
commit 61a2ef3
Showing
3 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
server { | ||
listen 443 ssl; | ||
server_name localhost; | ||
|
||
# Path to SSL certificate and key | ||
ssl_certificate /etc/ssl/certs/localhost.cer; | ||
ssl_certificate_key /etc/ssl/private/localhost.key; | ||
|
||
# Root directory for the Angular app | ||
root /usr/share/nginx/html; | ||
|
||
# Default file to serve | ||
index index.html; | ||
|
||
# Redirect HTTP traffic to HTTPS | ||
error_page 404 /index.html; | ||
|
||
# Handle Angular's HTML5 pushState | ||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
# Optional: Gzip compression for improved performance | ||
gzip on; | ||
gzip_types text/plain application/javascript text/css application/json application/xml text/javascript; | ||
gzip_min_length 1024; | ||
} | ||
|
||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
# Serve static files from /usr/share/nginx/html | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
|
||
# Error pages | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |