【发布时间】:2018-12-22 08:50:05
【问题描述】:
duelingpetWS2 水滴 地址:http://68.183.163.139/
当前安装:
NodeJS
NPM
Rbenv
ruby 2.5.1p57
Rails 5.2.2
MySQL
Ubuntu 18.04
nginx
/var/www/duelingpets.net/html/index.html
<html>
<head>
<title>Welcome to Duelingpets.net!</title>
</head>
<body>
<h1>Success! The duelingpets.net server block is working!</h1>
</body>
</html>
新版本 /etc/nginx/sites-available/duelingpets.net
upstream duelingpets {
server unix:///path/to/web/tmp/puma.sock;
}
server {
listen 80;
listen [::]:80;
root /var/www/duelingpets.net/html;
#index index.html index.htm index.nginx-debian.html;
server_name duelingpets.net www.duelingpets.net;
try_files $uri @app;
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://duelingpets;
}
}
旧版本 /etc/nginx/sites-available/duelingpets.net
server {
listen 80;
listen [::]:80;
root /var/www/duelingpets.net/html;
index index.html index.htm index.nginx-debian.html;
server_name duelingpets.net www.duelingpets.net;
location / {
try_files $uri $uri/ =404;
}
}
sudo ln -s /etc/nginx/sites-available/duelingpets.net /etc/nginx/sites-enabled/
sudo vim /etc/nginx/nginx.conf
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
网站的当前行为。
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
【问题讨论】:
-
显示 Rails 应用程序的 apache 配置,它指向 /public 目录,而不是将请求转发到 rails appserver 进程
-
好的,我刚刚编辑了我的原始帖子并添加了 apache2 站点可用的 conf 文件。好的,它应该指向哪个部分?在 Rails 3.2 中,您最初必须将其指向 /public 目录才能使其工作。 Rails 5.2 需要指向哪里?
标签: ruby-on-rails apache digital-ocean ruby-on-rails-5.2