pygps/nginx.conf
2018-02-11 11:16:39 +01:00

40 lines
890 B
Nginx Configuration File

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