Server Deployment - nginx
1. proxy configuration
The configuration file is /etc/nginx/nginx.conf, but I can change another file:
>vi /etc/nginx/conf.d/easymarket.conf
configuration files:
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
upstream easy {
ip_hash;
server localhost:8083;
server localhost:8084;
server localhost:8085;
}
server {
listen 83;
server_name localhost;
charset utf-8;
access_log logs/host.access.log main;
location /nginxstatus {
stub_status on; #nginx status watch
access_log off;
}
location / {
proxy_pass http://easy;
proxy_set_header X-Real-IP $remote_addr;
}
#location / {
# 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;
}
}
we can see the status with URL
http://localhost:83/nginxstatus
2. config the perl cgi
The configuration file easymarket.conf will be as follow:
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
upstream easy {
ip_hash;
server localhost:8083;
server localhost:8084;
server localhost:8085;
}
server {
listen 83;
server_name localhost;
charset utf-8;
access_log logs/host.access.log main;
root /var/www;
location /nginxstatus {
stub_status on; #nginx status watch
access_log off;
}
location ~\.pl$ {
gzip off;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME /var/www/easyperl$fastcgi_script_name;
}
location /easymarket {
proxy_pass http://easy;
proxy_set_header X-Real-IP $remote_addr;
}
#location / {
# 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;
}
}
Test the Perl page:
http://localhost:83/easyperl/Action.pl
http://localhost:83/easyperl/All.pl
references:
http://hi.baidu.com/luohuazju/blog/item/8baa8f1738303c0a4b90a771.html
http://hi.baidu.com/luohuazju/blog/item/f7880d822e5f12b86c811902.html
http://library.linode.com/web-servers/nginx/perl-fastcgi/ubuntu-11.04-natty
分享到:
相关推荐
Nginx-Gunicorn-Django-deployment-in-Ubuntu-16.04-Fabric:使用Fabric的Nginx-Gunicorn-Django在Ubuntu-16.04中的部署
使用Kubernetes部署应用程序该存储库显示了如何使用kubernetes部署Nginx应用程序。 部署的应用程序具有3个副本。 在CLI上,您必须执行以下命令来启动和运行您的应用程序。 请记住将webserver.yaml和webserver-svc....
wget https://github.com/janforman/linux-server-install/archive/main.zip -O /tmp/t.zip && unzip /tmp/t.zip -d /tmp && rm /tmp/t.zip && cd /tmp/linux-server-install-main/ && ./install.sh nginx(使用php...
项目虽然是采用 React Native ...sudo ln -s deployment/nginx /etc/nginx/sites-enabled/mysitename.conf API设计及文档 API采用restful API风格设计。 三种类型的请求: GET获取数据 POST 创建数据 PUT/PATCH 修改数
在不到10分钟的时间内,使用Nginx(w / HTTPS),PHP FPM,Postfix,OpenDKIM,MySQL / MariaDB,PostgreSQL等启动完整配置的基于Ubuntu / Debian的Web服务器。 也部署您的Web应用程序。 Instant Start对于以最小的...
前言 本项目虽然是采用 ...sudo ln -s deployment/nginx /etc/nginx/sites-enabled/mysitename.conf API设计及文档 API采用restful API风格设计。 三种类型的请求: GET 获取数据 POST 创建数据 PUT/PATCH 修改数据
deploymentAbout web host deployment, web hosting resources###服务器资源hosting-resource.md###web服务部署ubuntu-server-deployment.mdsupervisor+gunicorn+nginx###java配置java_on_ubuntu.md###MISCOpenshift...
NodeJS部署指南带有Nginx,PM2和Certbot的NodeJS应用程序的部署指南。部署类型资源初始服务器部署1.设置Ubuntu Server 20.04 sudo apt updatesudo apt upgrade2.设置OpenSSH Server并复制SSH密钥偏僻的: sudo ufw ...
# Server deployment 服务器使用Nginx部署,nginx.conf在config目录中 监听端口需修改为自己想部署的端口 if 需要跨域请求 nginx.conf需添加代理 可参考108-111行 注:如代理https,nginx需添加SSL模块 参照...
各个子系统前台thymeleaf模板,前端资源模块,使用nginx代理,实现动静分离。 > zheng-upms 本系统是基于RBAC授权和基于用户授权的细粒度权限控制通用平台,并提供单点登录、会话管理和日志管理。接入的系统可自由...
这个Django Boilerplate快速将您的源代码封装在Nginx反向代理后面运行Gunicorn的Docker容器中。 该项目使用Fabric3来处理大多数部署和管理任务。 先决条件 pip-您可以使用安装pip brew install pip 我建议您使用来...
无需Docker,不需要nginx知识! 这是什么? 对于您的NodeJS,Python,PHP,ASP.NET,Ruby,MySQL,MongoDB,Postgres,WordPress(等)应用程序, CapRover是一个非常易于使用的应用程序/数据库部署和Web服务器...
詹果蝇它是一个有用的命令行工具,用于在Linux web server使用NGINX,Supervisor,Gunicorn和Letsencrypt管理(初始化和更新)部署设置。 当前版本仅适合django2.2.x。 部署Django Web应用程序是我个人使用的命令。...
Deploying and Maintaining Production Instances, shows us how to prepare a server for production prime time, explaining what configuration should be taken care of and how to configure an Nginx reverse...
Deployment policy: Rolling (batch size: fixed 1) 服务器 server ready delay: 60 seconds server send ok delay: 10 seconds 客户 call "/test" interval: 5 seconds requset timeout: 40
and pinning Guide to using OpenSSL to generate keys and certificates and to create and run a private certification authority Guide to ...Practical advice for secure server configuration using Apache httpd...
8. Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Key 235 Key ...
TAN 这是用于Debian或Ubuntu服务器的初始安装和配置的脚本集,以用作Web托管。要求没有预装软件的服务器Debian 7或Debian 8 要么Ubuntu服务器16 可以上网。 最小RAM 256 MB 。 推荐的RAM 1 GB或更多。...
如果要填写10个字,则可以输入loren10并按Enter 要复制整行并粘贴在下面,您可以使用option + shift +向下箭头您可能需要的有用扩展:Eslint,Prettier,HTML代码段,复制相对路径,代码拼写检查器,Live Server,...