Answer the question
In order to leave comments, you need to log in
How to replace localhost:3000 with dev when starting rails server?
How to configure nginx and what to write in /etc/hosts to type dev instead of localhost:3000 in the browser line every time you start rails server?
Answer the question
In order to leave comments, you need to log in
1) Use dns-masq
2) Install nginx to proxy requests. Something like this.
server {
listen 80;
root /path/to/project/public;
index index.html;
server_name project.dev;
location / {
try_files $uri $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://localhost:3000;
}
location ~ /\. {
access_log off;
deny all;
}
error_log /var/log/nginx/project-error.log error;
access_log /var/log/nginx/project-access.log;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question