
So, you're on Nginx. That alone is an awesome move. As long as you're sure that everything you need is within Nginx, no need to load up on features that you won't use (from Apache).
Some of the things important to keep in mind about Nginx:
usual Nginx configuration file path: /opt/nginx/conf/nginx.conf
usual Nginx access log file path /var/log/nginx/access.log
usual Nginx error log file path /var/log/nginx/error.log
To Restart: sudo service nginx start
To Stop: sudo service nginx stop
To Reload: sudo service nginx reload
Because I encountered these problems, here are some tips I learned:
Tip #1
If you have this directive:
gzip_types text/plain text/css application/x-javascript application/xml application/xml+rss text/javascript;
just make sure that you remove text/html in the values you provide. gzip_types
already include text/html by default.
Tip #2
If you encounter any errors on binding to any ports, such as this:
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
make sure that you kill all those connected to the port in question. You can either do:
sudo fuser -k 80/tcp
or
sudo killall nginx
before you start/restart nginx again.
Tip #3
When deploying a rails app, put
rails_env environment;
just replace environment
with whatever you call your environment: [development, staging, test, production, etc]
Sources:
- https://rtcamp.com/tutorials/nginx/troubleshooting/emerg-bind-failed-98-address-already-in-use/
- and my own debugging experience
Author
Maricris Nonato
I turn tech ideas into websites using Ruby. I'm a budding Buddhist practitioner, passionate about health & fitness, a certified yoga teacher, and a cat fanatic!
Recent posts
Tags
- cats
- yoga
- blood pressure
- elecom
- scrum
- coderkitty
- RailsGirls
- workstation
- creativity
- live book signing
- healthy living
- lowering blood pressure
- crafting
- movies
- reviews
- new year
- blessings
- faith
- quotes to live by
- travelers notebook
- Bujo
- planners
- Monday Motivation
- himalayan salt lamp
- productivity
- life tips
- happiness
- success
- ruby
- digital ocean
- regex
- programming
- humor
- music
- pyromusical
- sphinx
- mac
- games
- musings
- yogi
- namaste
- photography
- hobby
- slimming
- sendmail
- lifestyle
- memes
- open letter
- sports
- shooting
- events
- meetups
- tech talks
- rails
- datatables
- sorting
- cycling
- COVID-19
- wishlist
- xmas
- tradition
- song lyrics
- life lessons
- poems
- short story
- food
- living life
- nginx
- technology
- youtube
- my Nyey
- meditation
- new normal
- jump rope
- two-wheel journey
- planner girl
- rubyist
- culture
- Filipino
- mental health
- counseling
- self-care
Advertise
Newsletter
Instagram Feed
Links
I'm sharing with you P150 gift from GoFutureFresh! Click here to accept my gift.