Jump to content
IPS Community Suite 简体中文

Search the Community

Showing results for tags 'nginx'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Public docs
  • Server Softwares
    • IPS
    • WordPress
  • 其它
    • Scratch
    • Python
    • Ubuntu & LinuxMint
    • Softwares
    • WordPress Plugins

Blogs

  • Dev

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. 本文给出 IPS Community Suite 4.2.6 可用的 Nginx 重写规则。 在 IPS Community Suite 后台,可以直接下载 Apache 的重写规则,但是没有对 Nginx 支持太好,所以,就需要根据自己的情况,写下适用于 Nginx 的重写规则了。 This post will give you a sample about how to config your IPS Community Suite SEO Urls on Nginx . IPS Community Suite Nginx rewrite rules as following: server{ listen 80; #listen end server_name 你的域名; index index.html index.htm index.php; #set $subdomain ''; #root /home/wwwroot/html/$subdomain; #或者直接写绝对路径 root /home/wwwroot/html/你的域名; # 包含其它 Nginx 配置,一般是 fastcgi 相关的配置文件 #include /home/**/other.conf; #rewrite end # Set up rewrite rules. location / { # index index.php; try_files $uri $uri/ /index.php; # 下面的也行 # try_files $uri $uri/ /index.php?$args; } location ~^(/page/).*(.php)$ { try_files $uri $uri/ /index.php; } # Stub Status module location /server_status { # stub_status on; #allow 127.0.0.1; #deny all; } # GZIP static content not processed by IPB. gzip on; gzip_static on; gzip_http_version 1.1; gzip_vary on; gzip_comp_level 6; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript application/xml application/xml+rss text/javascript application/javascript text/x-js; gzip_buffers 16 8k; gzip_disable "MSIE [1-6].(?!.*SV1)"; # IP.Board PHP/CGI Protection location ~^(/uploads/).*(.php)$ { deny all; } location ~^(/hooks/).*(.php)$ { deny all; } location ~^(/cache/).*(.php)$ { deny all; } location ~^(/screenshots/).*(.php)$ { deny all; } location ~^(/downloads/).*(.php)$ { deny all; } location ~^(/blog/).*(.php)$ { deny all; } location ~^(/public/style_).*(.php)$ { deny all; } # Caching directives for static files. location ~^(/uploads/profile/).*.(jpg|jpeg|gif|png)$ { access_log off; expires 1d; } location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|htm|txt|swf|cur)$ { access_log off; expires 1w; } #error_page error_page 400 /ErrorPages/400.html; error_page 403 /ErrorPages/403.html; error_page 404 /ErrorPages/404.html; error_page 502 /ErrorPages/502.html; location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$ { root /home/wwwroot/lnmp02/domain/bbs/web; } location ~ .*\.php$ { # 如果你在Ubuntu 或者 LinuxMint 上安装,可能如此 fastcgi_pass unix:/run/php7.0-fpm.sock; fastcgi_index index.php; include fcgi.conf; fastcgi_param DOCUMENT_ROOT /home/wwwroot/html/你的域名; fastcgi_param SCRIPT_FILENAME /home/wwwroot/html/你的域名$subdomain$fastcgi_script_name; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$ { expires 30d; } location ~ .*\.(js|css)$ { expires 12h; } # 不要日志 access_log off; error_log /dev/null; } 按自己的 Nginx 和网站的路径配置,改写下上面的规则,然后在使用 Nginx 检查重写规则后,重载即可。 you may modify the above rules according your Nginx and the directory of your IPS ,then check rules via Nginx, and reload it. sudo nginx -t sudo nginx reload 下面再提供一个在 Ubuntu 上安装的 IPS 实例的 Nginx 规则: server { # listen 80 default_server; # listen [::]:80 default_server; server_name ips73.com; root /var/www/html/ips73.com; index index.php index.html index.htm index.nginx-debian.html; client_max_body_size 100M; # enforce NO www if ($host ~* ^www\.(.*)){ set $host_without_www $1; rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent; } #########IPS location ~ .*\.php$ { include /etc/nginx/snippets/fastcgi-php.conf; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; include fastcgi_params; fastcgi_param DOCUMENT_ROOT /var/www/html/ips73.com; fastcgi_param SCRIPT_FILENAME /var/www/html/ips73.com$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; client_body_timeout 3000; fastcgi_read_timeout 3000; client_max_body_size 32m; fastcgi_buffers 8 128k; fastcgi_buffer_size 128k; send_timeout 600; keepalive_timeout 600; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; } location ~^(/page/).*(.php)$ { try_files $uri $uri/ /index.php; } location ~^(/uploads/).*(.php)$ { deny all; } location ~^(/hooks/).*(.php)$ { deny all; } location ~^(/cache/).*(.php)$ { deny all; } location ~^(/screenshots/).*(.php)$ { deny all; } location ~^(/downloads/).*(.php)$ { deny all; } location ~^(/blog/).*(.php)$ { deny all; } location ~^(/public/style_).*(.php)$ { deny all; } # Caching directives for static files. location ~^(/uploads/profile/).*.(jpg|jpeg|gif|png)$ { access_log off; expires 1d; } location ~* ^.+\.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ { expires 1m; access_log off; add_header Cache-Control "public"; } #location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|ttf|woff|woff2)$ { #expires 1m; #access_log off; #add_header Cache-Control "public"; #} #########IPS// # |php location ~ \.(aspx|asp|jsp|cgi)$ { return 410; } # CSS and Javascript location ~* \.(?:css|js)$ { expires 1m; access_log off; add_header Cache-Control "public"; } # unless the request is for a valid file, send to bootstrap if (!-e $request_filename){ rewrite ^(.+)$ /index.php?q=$1 last; } }
×