您必须运行像 nginx 或 apache 这样的网络服务器。nginx 配置可能如下所示:
server {
listen 8080;
server_name mydomain.com
root /path/to/your/static/files;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://127.0.0.1:8090;
}
}
server {
listen 8080;
server_name sub.mydomain.com
root /path/to/your/static/files;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://127.0.0.1:8092;
}
}
proxy_pass http://127.0.0.1:8092;
作为您的 RoR 应用程序的 url。