Add sample nginx config
This commit is contained in:
parent
0aa1f1464e
commit
06d59c79a8
1 changed files with 40 additions and 0 deletions
40
nginx.conf
Normal file
40
nginx.conf
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen 443 ssl http2;
|
||||||
|
|
||||||
|
server_name gps.example.com;
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/gps.example.com/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/gps.example.com/privkey.pem;
|
||||||
|
include snippets/ssl.conf;
|
||||||
|
|
||||||
|
if ($ssl_protocol = "") {
|
||||||
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /endpoint.php {
|
||||||
|
proxy_pass http://127.0.0.1:6957/endpoint;
|
||||||
|
}
|
||||||
|
location /endpoint {
|
||||||
|
proxy_pass http://127.0.0.1:6957/endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /lib/ {
|
||||||
|
root /opt/pygps/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
auth_basic "GPS Tracker";
|
||||||
|
auth_basic_user_file "/etc/nginx/auth/gps";
|
||||||
|
proxy_pass http://127.0.0.1:6957/;
|
||||||
|
proxy_connect_timeout 600;
|
||||||
|
proxy_send_timeout 600;
|
||||||
|
proxy_read_timeout 600;
|
||||||
|
send_timeout 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /.well-known/ {
|
||||||
|
root /opt/pygps/;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue