0
導航到我的應用程序主頁面中的鏈接頁面時出現此錯誤。從主頁/主頁導航到另一個頁面時導致Nginx的404錯誤(Rails 5,AWS EC2)
我使用Nginx的和乘客
在application/_header.html.erb
文件我有這行thelink:
<li><%= link_to 'Comments', comments_path, method: "get" %></li>
爲其在routes.rb
我: root to: "application#index" resources :comments
我/etc/nginx/sites-available/default
是
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/ubuntu/test-aws-deploy-with-git-ec2-rds/public;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name ec2-54-173-78-253.compute-1.amazonaws.com;
location/{
proxy_pass http://127.0.0.1:4000;
proxy_http_version 1.1;
proxy_buffering off;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
不知道爲什麼我不能在這個應用程序之間導航頁面? 我是否需要指定此應用將使用的任何頁面的某處?
非常感謝你!!我一直在這個問題上苦苦掙扎2天... – prasanthrubyist