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 https://$host:5050; } location /phpmyadmin { proxy_pass https://$host:5000; } } 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