-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
2 changed files
with
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
worker_processes 1; | ||
|
||
user nobody nogroup; | ||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
error_log /dev/stdout info; | ||
|
||
events { | ||
worker_connections 1024; | ||
accept_mutex off; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
|
||
default_type application/octet-stream; | ||
access_log /dev/stdout combined; | ||
sendfile on; | ||
|
||
upstream app_server { | ||
server unix:/app/gunicorn.sock fail_timeout=0; | ||
} | ||
|
||
server { | ||
listen 8080 deferred default_server; | ||
client_max_body_size 4G; | ||
|
||
keepalive_timeout 5; | ||
|
||
# path for static files | ||
root /contactform; | ||
|
||
location / { | ||
# checks for static file, if not found proxy to app | ||
try_files $uri @proxy_to_app; | ||
} | ||
|
||
location @proxy_to_app { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_pass http://app_server; | ||
} | ||
} | ||
} |