【发布时间】:2018-03-31 08:44:17
【问题描述】:
我无法访问 API。
我正在使用 Nginx 和Passenger。我正在使用 Capistrano 进行部署。
我在 Nginx 站点中的默认文件可用
##
##
# Default server configuration
#
server {
listen 80;
root /var/www/xyz/current/public;
# Add index.php to the list if you are using PHP
# index index.html index.htm index.nginx-debian.html;
passenger_enabled on;
rails_env staging;
server_name ec2-258-255-77-987.eu-west-2.compute.amazonaws.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
我无法从同一服务器访问 API 并得到 404
请帮帮我
编辑
我检查了错误日志,它显示路由错误。
我的应用程序位于 var/www/xyz/current
我的路线有什么问题?
【问题讨论】:
标签: ruby-on-rails api nginx capistrano passenger