http://example.comがhttp://example.com/home.html /home/ubuntu/mysitedir/home.htmlから配信しようとしています。nginxのルートディレクティブが原因で404
私はすべてをhttpsに、そしてプロキシをuwsgiに正常にリダイレクトする次のconfファイルを持っています。 http-> httpsリダイレクトはうまく動作し、uwsgiプロキシは動作しますが、http://example.com/、http://example.com/home.html、http :(s):// example.com/index.html、http:s://example.com/index.htmはすべて404
私は何を試すことができますか?
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
root /home/ubuntu/mysitedir/;
index home.html;
}
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/nginx/ssl/example_combined.crt;
ssl_certificate_key /etc/nginx/ssl/www.example.com.key;
root /home/ubuntu/mysitedir/;
index home.html;
location /images/ads {
alias /home/ubuntu/mysitedir/images/ads/;
}
location /images {
alias /home/ubuntu/mysitedir/images/;
}
location /static {
alias /home/ubuntu/mysitedir/static/;
}
location/{
alias /home/ubuntu/mysitedir/;
include uwsgi_params;
uwsgi_pass unix:/tmp/mysitedir.sock;
}
}
ありがとう:
は、ここに私のconfファイルです。
ありがとうございます。私はそれを試してみました。また、/ home/ubuntu/mysitedir /と/ usr/share/nginx/html /にindex.htmとindex.htmlを置くと、http:s:/example.com/、http:s: /example.com/home.html、http(s)://example.com/index.html、htt(s)p://example.com/index.htmはすべて404です –
@stubblejumperは何に更新されましたか私はうまくいくと思う。 – miah
素晴らしいです。あなたの助けに感謝します。 –