-
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.
* add unix domain socket support * fixed nginx configuration
- Loading branch information
1 parent
b2d51f0
commit 56231b5
Showing
6 changed files
with
78 additions
and
35 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
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,34 @@ | ||
# Nginx config template | ||
# Don't forget to change it to meet your own env | ||
upstream uvicorn { | ||
server unix:/tmp/randomology/uvicorn.sock; | ||
} | ||
|
||
server { | ||
listen 80; | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
|
||
client_max_body_size 4G; | ||
|
||
server_name example.com; | ||
|
||
ssl_certificate /path/to/fullchain.pem; | ||
ssl_certificate_key /path/to/privkey.pem; | ||
|
||
location / { | ||
root /var/www/example.com/public; | ||
} | ||
|
||
# your webhook | ||
location /your-webhook-uri { | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_redirect off; | ||
proxy_buffering off; | ||
proxy_pass http://uvicorn/your-webhook-uri; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,27 +1,8 @@ | ||
# Nginx config template | ||
# Don't forget to change it to meet your own env | ||
|
||
server { | ||
listen 80; | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
|
||
server_name example.com; | ||
|
||
ssl_certificate /path/to/fullchain.pem; | ||
ssl_certificate_key /path/to/privkey.pem; | ||
|
||
# redirect to https | ||
if ($scheme = http) { | ||
return 301 https://$server_name$request_uri; | ||
} | ||
|
||
location / { | ||
root /var/www/example.com/public; | ||
} | ||
|
||
# your webhook | ||
location /your-webhook-uri { | ||
proxy_pass http://127.0.0.1:8443/your-webhook-uri/; | ||
# move map block to system nginx.conf | ||
http { | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
} |
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