私はnode.js
アプリとnginx
を持っているデジタル海洋のトイレットを持っています。nginx link nodejsアプリをサブドメイン
だから、私はnginxのをインストールし、その後/etc/nginx/sites-available/
に私は、次の内容持つapi
と呼ばれる新しいファイルを作成しました:私はnginxのをrestaredことを作成した後
server {
server_name api.my-website.com;
location/{
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $proxy_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:9000; // this is where the node app lives
}
}
を私はapi.my-に行く場合website.com私は何も見ません(私のAPIは/にあるランディングページを持っていますが、my-website.com:9000に行くと、api.my-website.com上にあるはずのランディングが見えます)。
私が間違っていることを誰かが説明できますか?
'/ etc/nginx/sites-enabled /'へのシンボリックリンクをインストールしましたか? –
私はそうは思わない、私はチュートリアルに従った、どうすればいい? – Anderson