dacongyun.com
分享国内外服务器主机优惠信息

求解答lnmp 俩个nginx配置的问题

/usr/local/nginx/conf/nginx.conf

  1. user  www www;
  2. worker_processes auto;
  3. worker_cpu_affinity auto;
  4. error_log  /home/wwwlogs/nginx_error.log  crit;
  5. pid        /usr/local/nginx/logs/nginx.pid;
  6. #Specifies the value for maximum file descriptors that can be opened by this process.
  7. worker_rlimit_nofile 51200;
  8. events
  9.     {
  10.         use epoll;
  11.         worker_connections 51200;
  12.         multi_accept off;
  13.         accept_mutex off;
  14.     }
  15. http
  16.     {
  17.         include       mime.types;
  18.         default_type  application/octet-stream;
  19.         server_names_hash_bucket_size 128;
  20.         client_header_buffer_size 32k;
  21.         large_client_header_buffers 4 32k;
  22.         client_max_body_size 50m;
  23.         sendfile on;
  24.         sendfile_max_chunk 512k;
  25.         tcp_nopush on;
  26.         keepalive_timeout 60;
  27.         tcp_nodelay on;
  28.         fastcgi_connect_timeout 300;
  29.         fastcgi_send_timeout 300;
  30.         fastcgi_read_timeout 300;
  31.         fastcgi_buffer_size 64k;
  32.         fastcgi_buffers 4 64k;
  33.         fastcgi_busy_buffers_size 128k;
  34.         fastcgi_temp_file_write_size 256k;
  35.         gzip on;
  36.         gzip_min_length  1k;
  37.         gzip_buffers     4 16k;
  38.         gzip_http_version 1.1;
  39.         gzip_comp_level 2;
  40.         gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
  41.         gzip_vary on;
  42.         gzip_proxied   expired no-cache no-store private auth;
  43.         gzip_disable   “MSIE [1-6]\.”;
  44.         #limit_conn_zone $binary_remote_addr zone=perip:10m;
  45.         ##If enable limit_conn_zone,add “limit_conn perip 10;” to server section.
  46.         server_tokens off;
  47.         access_log off;
  48. server
  49.     {
  50.         listen 80 default_server reuseport;
  51.         #listen [::]:80 default_server ipv6only=on;
  52.         server_name wprdpress;
  53.         index index.html index.htm index.php;
  54.         root  /home/wwwroot/zblog.com;
  55.         #error_page   404   /404.html;
  56.         # Deny access to PHP files in specific directory
  57.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
  58.         include enable-php.conf;
  59.         location /nginx_status
  60.         {
  61.             stub_status on;
  62.             access_log   off;
  63.         }
  64.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

复制代码

/usr/local/nginx/conf/vhost/域名.conf

  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name zblog.com ;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /home/wwwroot/zblog.com;
  8.         include rewrite/other.conf;
  9.         #error_page   404   /404.html;
  10.         # Deny access to PHP files in specific directory
  11.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
  12.         include enable-php-pathinfo.conf;
  13.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  14.         {
  15.             expires      30d;
  16.         }
  17.         location ~ .*\.(js|css)?$
  18.         {
  19.             expires      12h;
  20.         }
  21.         location ~ /.well-known {
  22.             allow all;
  23.         }
  24.         location ~ /\.
  25.         {
  26.             deny all;
  27.         }
  28.         access_log off;
  29.     }
  30. ~                    

复制代码

这个好像管静态的

我想放多个网站就改第一个文件就行吧应该
排版很烂,见谅

网友回复:

注册 你再新建个conf不就行了嘛….

pulpfunction 我用lnmp建会再生成一个/usr/local/nginx/conf/vhost/域名b.conf 我意思是这种情况在第一个/usr/local/nginx/conf/nginx.conf,这个里设置就行哇 问题是不会啊一个内网机器,我想在a网站里点击,能跳转到另一个网站b a站是zblog,b站小说站

流河旱树 c站还打算弄个电影站,给单位放

pulpfunction 好的 谢谢

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人支付接口

云免签H5支付