Skip to content

Commit

Permalink
nginx updates
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmostafa committed Nov 26, 2024
1 parent e29e703 commit 76926c0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ services:
volumes:
- ./web:/var/www
- node_modules:/var/www/node_modules
- ./etc/ssl:/etc/ssl
- ./etc/nginx:/etc/nginx/conf.d
- ./etc/nginx/log/:/var/log/nginx
- ./web/etc/ssl:/etc/ssl
- ./web/etc/nginx/conf.d:/etc/nginx/conf.d
- ./web/etc/nginx/log:/var/log/nginx
api:
build:
context: ./api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ server {
location = /50x.html {
root /usr/share/nginx/html;
}
}
}
49 changes: 49 additions & 0 deletions web/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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;

# 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;
}

# 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;
}
}

0 comments on commit 76926c0

Please sign in to comment.