NGINX+PHP-金山逍遥网CMS公布系统配置

2023-03-02,,,,

NGINX+PHP-金山逍遥网CMS发布系统配置

user  www www;

worker_processes 8;

error_log  /data1/logs/nginx_error.log  crit;

pid        /usr/local/webserver/nginx/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process. 
worker_rlimit_nofile 51200;

events 
{
 use epoll;
 worker_connections 51200;
}

http 
{
 include       mime.types;
 default_type  application/octet-stream;

 #charset  utf-8;
     
 server_names_hash_bucket_size 128;
 client_header_buffer_size 32k;
 large_client_header_buffers 4 32k;
 client_max_body_size 300m;
 client_body_buffer_size 128k;
     
 sendfile on;
 #tcp_nopush     on;

 keepalive_timeout 65;

 tcp_nodelay on;

 fastcgi_connect_timeout 300;
 fastcgi_send_timeout 300;
 fastcgi_read_timeout 300;
 fastcgi_buffer_size 64k;
 fastcgi_buffers 4 64k;
 fastcgi_busy_buffers_size 128k;
 fastcgi_temp_file_write_size 128k;

 gzip off;
 gzip_min_length  1k;
 gzip_buffers     4 16k;
 gzip_http_version 1.1;
 gzip_comp_level 2;
 gzip_types       text/plain application/x-javascript text/css application/xml;
 gzip_vary on;

 #limit_zone  crawler  $binary_remote_addr  10m;

 server
 {
   listen       80;
   server_name  cms.xoyo.com;
   index index.html index.htm index.php;
   root  /data0/htdocs/cms.xoyo.com;

   location ~ .*\.(sh|bash)?$ { return 403; }

   location / {
        index index.html index.php;
  #如果请求的文件不存在,则重定向到单一入口文件上
        if (!-f $request_filename)
        {
                rewrite ^/(.*)$ /application/cmsmanage/index.php last;
        }
   }

   location ~ .*\.(php|php5)?$
   {
     #fastcgi_pass  unix:/tmp/php-cgi.sock;
     fastcgi_pass  127.0.0.1:9000;
     fastcgi_index index.php;
     include fcgi.conf;
   }

   log_format  cms  '$remote_addr - $remote_user [$time_local] "$request" '
              '$status $body_bytes_sent "$http_referer" '
              '"$http_user_agent" $http_x_forwarded_for';
   access_log  /data1/logs/cms.xoyo.com_access.log  cms;
 }
}

?

NGINX+PHP-金山逍遥网CMS发布系统配置

本文转载自【PHP中文网】,希望能给您带来帮助,苟日新、日日新、又日新,生命不息,学习不止。

《NGINX+PHP-金山逍遥网CMS公布系统配置.doc》

下载本文的Word格式文档,以方便收藏与打印。

  • php的each函数的应用场景有哪些
    php的each函数的应用场景有哪些

    遍历关联数组:each函数可以用来遍历关联数组,并返回当前元素的键和值。 遍历数组并取出键和值:通过each函数可以遍历数组并取出键和值,对数组中的每个元素进行操作。 与while循环配合使用:each函数通常...

    2024-05-15编程代码
  • php返回数据的方法是什么
    php返回数据的方法是什么

    PHP返回数据的方法通常是通过使用echo或print语句来输出数据。例如: <?php $data = "Hello, World!"; echo $data; ?> 上面的代码将输出 “Hello, World!” 到浏览器或命令行。除了echo和prin...

    2024-05-15编程代码
  • php ucfirst函数的用法是什么
    php ucfirst函数的用法是什么

    ucfirst() 函数用于将字符串的首字母转换为大写。其语法如下: ucfirst(string $string): string 示例: $str = "hello world"; echo ucfirst($str); // 输出 "Hello world" 注意:ucfirst...

    2024-05-15编程代码
  • php时间戳转换时要注意哪些事项
    php时间戳转换时要注意哪些事项

    时区问题:在将时间戳转换为特定时间格式时,需要考虑使用正确的时区来显示时间,以确保时间显示的准确性。 时间格式:在进行时间戳转换时,需要明确需要将时间戳转换成什么格式的时间,如年月日时分秒等。 ...

    2024-05-15编程代码
  • php的ucfirst函数有什么作用
    php的ucfirst函数有什么作用

    ucfirst() 是 PHP 中的一个内置函数,用于将字符串中的第一个字符转换为大写。这个函数对于将字符串的首字母大写尤其有用,例如在人名、地名或标题中。 这个函数非常简单,只需要接收一个字符串作为参数,然后返...

    2024-05-15编程代码
  • php日期怎么转为字符串
    php日期怎么转为字符串

    在PHP中,可以使用date()函数将日期和时间转换为字符串。以下是一个简单的示例: $date = strtotime("2022-01-01"); $stringDate = date("Y-m-d", $date); echo $stringDate; // 输出:2022-...

    2024-05-15编程代码
  • php怎么打乱数组顺序
    php怎么打乱数组顺序

    在PHP中,要打乱数组顺序,您可以使用shuffle函数 <?php $array = array("apple", "banana", "cherry", "orange", "grape"); shuffle($array); print_r(...

    2024-05-13编程代码
  • php crc32函数的使用方法是什么
    php crc32函数的使用方法是什么

    PHP中的crc32函数用于计算一个字符串的32位CRC(循环冗余校验)值。其基本语法如下: crc32(string $string) : int 其中,$string是要计算CRC值的字符串。 下面是一个简单的示例: $str = "hello"; $c...

    2024-05-13编程代码