如何给nodejs开发的web 绑定域名
来源:互联网 发布:不求上进的玉子 知乎 编辑:程序博客网 时间:2024/04/29 03:38
如下是我博客和在线工具的nginx配置文件(nginx.conf),大家可以参考下,虽然写的有点简单,但是还是好使的。
博客 (http://www.9958.pw) 用的nodejs,端口3000,在线工具 (http://tool.9958.pw) 用的是apache+php+mysql,端口8080,2个应用都是通过nginx前端代理转发请求到对应端口服务上的。
#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on;upstream nginx.9958.com {server localhost:3000;} server { #nginx的监听端口 listen 80; #这里是请求域名 server_name 9958.pw www.9958.pw; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://nginx.9958.com; #请求转发到哪里 # root html; # index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }server { listen 80; server_name tool.9958.pw; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://tool.9958.pw:8080; # root html; # index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }}##############################################################################en d weixin.9958.pw################################### # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #}}
转载自:http://www.9958.pw/post/nodejs_domain
0 0
- 如何给nodejs开发的web 绑定域名
- 如何给nodejs开发的web 绑定域名
- NodeJs的web开发
- 如何绑定域名?如何绑定中文域名?
- 【web学习】如何绑定自己的Lofter独立域名——域名解析篇
- BlueMix如何绑定自己的域名?
- 如何利用github绑定自己的域名
- lnmp如何怎样修改绑定的域名?
- Apache如何绑定域名?
- 给大家分享web开发新手修改hosts文件实现本地域名访问的正确方法
- Nodejs绑定域名与Nginx反向代理
- 花生壳如何绑定域名,怎样绑定自己的域名发布网站
- 本地IIS如何绑定域名
- 本地IIS如何绑定域名
- 如何绑定阿里云域名
- dnn的域名绑定
- 如何安装配置你的Tomcat5并绑定域名
- 如何安装配置你的tomcat5并绑定域名
- descbc算法java版
- Service服务
- 截图工具
- 【unix网络编程第三版】阅读笔记(二):套接字编程简介
- 错误号org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
- 如何给nodejs开发的web 绑定域名
- 程序调试(1)GDB 基本使用
- 概念讲解+当前趋势:从RNN到LSTM
- java操作(DOM、SAX、JDOM、DOM4J)xml方式的四种比较与详解
- 配接器
- 并行计算
- 【C++】MFC 创建对话框,实现对“学生课程成绩”的管理
- hdu 1850 Being a Good Boy in Spring Festival(尼姆博奕)
- Retrofit 2.0 + OkHttp 3.0学习记录