Exemplos de Uso
$
server {
listen 443 ssl;
server_name api.meusite.com;
$
location / {
if ($http_x_api_key != "minha-chave-secreta-aqui") {
return 401 "Unauthorized";
}
proxy_pass http://127.0.0.1:8080;
}
$
location /admin-api {
allow 192.168.1.0/24;
deny all;
proxy_pass http://127.0.0.1:8080;
}
}
$
nginx -t && nginx -s reload