Skip to content

Instantly share code, notes, and snippets.

@mackwic
Created December 23, 2016 10:40
Show Gist options
  • Save mackwic/cf889a5d393bdca1dfcbb3e420b41139 to your computer and use it in GitHub Desktop.
Save mackwic/cf889a5d393bdca1dfcbb3e420b41139 to your computer and use it in GitHub Desktop.
root@ubuntu-xenial:~# curl yolo.sgmap.fr
poney
root@ubuntu-xenial:~# curl yolo.sgmap.fr/api
mangez des brocolis
root@ubuntu-xenial:~# curl -k --tlsv1.0 https://test.sgmap.fr
poney
root@ubuntu-xenial:~# curl -k --tlsv1.0 https://test.sgmap.fr/api
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.10.0 (Ubuntu)</center>
</body>
</html>
root@ubuntu-xenial:~# curl -k --tlsv1.2 https://test.sgmap.fr/api
mangez des brocolis
server {
listen 80;
server_name yolo.sgmap.fr;
error_log /tmp/nginx.yolo.tml debug;
location / {
return 200 'poney\n';
location /api {
return 200 'mangez des brocolis\n';
}
}
}
server {
listen 443 ssl;
server_name test.sgmap.fr;
error_log /tmp/nginx.log debug;
location / {
proxy_pass http://yolo.sgmap.fr;
location /api {
if ($ssl_protocol = "TLSv1.1") {
set $outdated_tls "outdated_tls";
return 400;
}
if ($ssl_protocol = "TLSv1") {
set $outdated_tls "outdated_tls";
return 400;
}
proxy_pass http://yolo.sgmap.fr/api;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment