Skip to content

Commit

Permalink
Fix nginx conf
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshinakasone committed Nov 25, 2023
1 parent 96e96ba commit 9128602
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 92 deletions.
91 changes: 0 additions & 91 deletions ansible/roles/nginx/files/etc/nginx/sites-available/default

This file was deleted.

48 changes: 48 additions & 0 deletions ansible/roles/nginx/files/etc/nginx/sites-enabled/isupipe.conf
@@ -0,0 +1,48 @@
server {
listen 80 default_server;
server_name _;
index index.html index.htm index.nginx-debian.html;
root /var/www/html;
location / {
try_files $uri $uri/ =404;
}
}

server {
listen 443 ssl default_server;
server_name _;
index index.html index.htm index.nginx-debian.html;
root /var/www/html;

# bot避けのためのvhostで、この証明書は有効期限がきれています
ssl_certificate /etc/nginx/tls/_.t.isucon.dev.crt;
ssl_certificate_key /etc/nginx/tls/_.t.isucon.dev.key;
ssl_protocols TLSv1.3;
ssl_prefer_server_ciphers off;

location / {
try_files $uri $uri/ =404;
}
}

server {
listen 443 ssl;
server_name u.isucon.dev;
server_name *.u.isucon.dev;

ssl_certificate /etc/nginx/tls/_.u.isucon.dev.crt;
ssl_certificate_key /etc/nginx/tls/_.u.isucon.dev.key;

ssl_protocols TLSv1.3;
ssl_prefer_server_ciphers off;

client_max_body_size 10m;
root /home/isucon/webapp/public/;
location / {
try_files $uri /index.html;
}
location /api {
proxy_set_header Host $host;
proxy_pass http://localhost:8080;
}
}
2 changes: 1 addition & 1 deletion ansible/roles/nginx/tasks/deploy.yaml
Expand Up @@ -9,7 +9,7 @@
notify: restart_nginx
with_items:
- etc/nginx/nginx.conf
- etc/nginx/sites-available/default
- etc/nginx/sites-enabled/isupipe.conf
- name: Change access.log permission
become: true
file:
Expand Down

0 comments on commit 9128602

Please sign in to comment.