基于nginx的静态网页部署的实现-创新互联
背景:

一序列的html网页需要部署
基于nginx的部署:
本文采用的基于openresty的nginx 配置。
简单地配置 Nginx 的配置文件,以便在启动 Nginx 时去启用这些配置即可实现对于编写好的html网页的点击跳转访问。而本文的重点也是于此。
配置方式1:
Nginx 的配置系统由一个主配置文件和其他一些辅助的配置文件构成。这些配置文件均是纯文本文件,一般地,我们只需要配置主配置文件就行了。/usr/local/openresty/nginx/conf 下的配置文件修改如下:
配置信息:
#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 {
resolver 10.1.16.10;
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr\t$remote_user\t[$time_local]\t$request '
'\t$status\t$body_bytes_sent\t$http_referer'
'\t$http_user_agent\t$http_x_forwarded_for'
'\t$host\t$request_time\t$upstream_addr\t$upstream_status\t$upstream_response_time';
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 30m;
sendfile on;
tcp_nopush on;
log_subrequest on;
keepalive_timeout 60;
tcp_nodelay on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
lua_package_cpath 'lib/?.so;tcp/lib/?.so;/data1/htdocs/lua_v2/lib/*/?.so;;';
lua_shared_dict cache 100m;
lua_code_cache on;
lua_shared_dict lyrics_monitor_cnt 1024K;
server {
listen 8081; # 监听本机所有 ip 上的 8081 端口
server_name _; # 域名:www.example.com 这里 "_" 代表获取匹配所有
root /home/liujiepeng/workspace/html/etc/resource/html/; # 站点根目录
index Home.html;
}
} 当前标题:基于nginx的静态网页部署的实现-创新互联
分享链接:http://www.jxjierui.cn/article/disjhj.html


咨询
建站咨询
