###前提・実現したいこと
さくらvps上のnginxにサブドメインでアクセスしたいです。
nginxのconfファイルを設定した後、サブドメインにアクセスすると
Not Found
The requested URL / was not found on this server.
が出たり出なかったりします…。
他のIPアドレス(携帯の回線)を使ったり、時間を置いてからアクセスしてみると、ファイルが表示されたりします。しかし、ページを更新するとまた404に戻ります。
そもそもドメインのネームサーバーの設定から失敗しているのかとも思いましたが、たまにアクセス出来たりもしてしまうので何ともいえない状況です…。
何かアクセスを制限する機能が働いているのでしょうか?
###該当のソースコード
/etc/nginx/nginx.conf
user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; server_tokens off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; }
/etc/nginx/conf.d/index.conf
server { listen 80; server_name hoge.hogehoge.com; location / { root /var/www/html; index index.php index.html index.htm; } }
/var/www/html には index.htmlのみがあります。
###補足情報(言語/FW/ツール等のバージョンなど)
さくらvps
ドメイン取得はお名前.com
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。