server { listen 443 ssl; listen [::]:443 ssl; ssl_certificate /root/ft_services.pem; ssl_certificate_key /root/ft_services_key.pem; server_name localhost; index index.html index.htm; root /www; location / { try_files $uri $uri/ =404; # if uri or uri/ not valid, 404 error } location /wordpress { return 307 http://$host:5050; } location /phpmyadmin/ { index index.php; proxy_pass http://phpmyadmin-service:5000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect /index.php /phpmyadmin/index.php; } } server { listen 80; listen [::]:80; server_name localhost; index index.html index.htm; root /www; location / { try_files $uri $uri/ =404; # if uri or uri/ not valid, 404 error } return 301 https://$host$request_uri; } # vim:ft=conf