Thursday, April 7, 2016

Mac Default website Congratulations, your Nginx seems to work just fine. :)

When I install nginx in the Mac, I met this question today,


猜测:
应可能是  nginx 代理了www.google.com 然后直接跳到了自己默认的网址!
目前不知道原因, 在解决

终于解决了,我们可以看到,其实是我们的www.google.com  被劫持了,我们输入的www.google.com 被重定向到了 nginx work!
不扯犊子,解决方案:
只有Safira Browser have the question.

Click command + ,

Click privacy button



you can click Remove All Website Data or  click   Detail button

you can see 


Remove ALL 
It works for me!

OK 



我想重启一下 nginx , 然后出现下面的问题:

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)





It won't start because the 8080 port is in use 





What is nginx.pid file?
What the important?


First we should know the port is being used?

Mac :

you can input 

netstat -anp tcp | grep 8080
you will get some info


If you Mac system is "EI Caption"
you should input 
lsof -i tcp:8080


How to look process pid number?
int the bash input :

ps -ax | grep nginx 

you can see this link:
http://www.chriswrites.com/how-to-view-and-kill-processes-using-the-terminal-in-mac-os-x/



ps -au | group nginx 

查询出来的Pid ,
然后使用  kill  pid

但是,kill 之后,又会有新的 进程出现,我不知道为什么 我的nginx 这么吊!
看来是我配置的问题呀!




I  will meet this question:

nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid"


Resolve method:

$ sudo nginx -c /usr/local/etc/nginx/nginx.conf

$ sudo nginx -s reload


-c  just you change file!
-s  reload nginx!

OK

you can check it by 

netstat -aup tcp | grep portNumber



Nginx   





No comments:

Post a Comment