2017-06-05 7 views
1

私はRedhat Ec2インスタンスを持っています。そして私はport 3000で走っている簡単なExpress Appを持っています。私はnginxをインストールし、私が使用している他のサブドメインに、s3バケット静的サイトを代理することができるので、正しく動作しています。しかし、私のサブドメインの1つに私のExpressアプリケーションをプロキシしようとすると、私はnginxの失敗ページを取得し続けます。ここで私は使用しています私のnginxのconfigブロックである:@DusanBajic答えにRedHat Ec2インスタンスでnginxにノードサーバーを取得できません

server { 
    listen  80; 
    listen  api.subdoamin.com:80; 
    server_name api.grouve.tech; 
    root   /usr/share/nginx/html; 

    # Load configuration files for the default server block. 
    include /etc/nginx/default.d/*.conf; 

    location/{ 
      proxy_pass http://00.000.00.000:3000; 
      expires 1y; 
      log_not_found off; 
      proxy_http_version 1.1; 
      proxy_set_header Upgrade $http_upgrade; 
      proxy_set_header Connection 'upgrade'; 
      proxy_set_header Host $host; 
      proxy_cache_bypass $http_upgrade; 
    } 
    error_page 404 /404.html; 
     location = /40x.html { 
    } 

    error_page 500 502 503 504 /50x.html; 
     location = /50x.html { 
    } 
} 
+1

で同じインスタンス上で実行しているノードとnginxのですか? –

+0

はい、同じインスタンス上で実行されています。私のノードアプリケーションは/ opt/apiで実行されています –

+0

あなたは 'proxy_pass http://127.0.0.1:3000;' –

答えて

1

おかげでsudo setenforce 0

+0

この修正は再起動後も存続しないことに注意してください。永久にselinuxを無効にする必要があります([fedora](https://docs.fedoraproject.org/en-US/Fedora/11/html/Security-Enhanced_Linux)。 /sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html)、[centos](https://www.centos.org/docs/5/html/5.1/Deployment_Guide/sec-sel-enable-disable.html)) –

+0

ありがとう@DusanBajic –

関連する問題