Skip to content

Commit

Permalink
Add ssl support.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadkhalaj committed Oct 12, 2023
1 parent b624a7d commit 703b205
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM nginx:alpine

RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
COPY nginx.conf /etc/nginx/conf.d
COPY fullchain.pem /etc/nginx/
COPY privkey.pem /etc/nginx/
11 changes: 10 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ upstream web {
server {
listen 80;
server_name foodinol.ir www.foodinol.ir;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
server_name foodinol.ir www.foodinol.ir;

ssl_certificate /etc/nginx/fullchain.pem;
ssl_certificate_key /etc/nginx/privkey.pem;

location / {
proxy_pass http://web;
Expand All @@ -17,4 +26,4 @@ server {
location /static/ {
alias /web/staticfiles/;
}
}
}

0 comments on commit 703b205

Please sign in to comment.