我用nginx配置兩個站點,一個站點要配置成https訪問,一個是http來訪問?
server {
<code> listen 443; server_name www.gzjjhd.com; ssl on; ssl_certificate E:/webserver/nginx/sslkey/wosign.com.crt; ssl_certificate_key E:/webserver/nginx/sslkey/wosign.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; ssl_prefer_server_ciphers on; location / { root E:/www/jsd; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { root E:/www/jsd; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } server { listen 80; server_name app.gzjjhd.com; location / { root E:/www/HDWeb; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } include E:/www/HDWeb/rewrite.conf; location ~ \.php$ { root E:/www/HDWeb; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } </code>
我這樣配置完,app.gzjjhd.com 也變成 https://appgzjjhd.com 來訪問。但是我不要這樣。我要http://app.gzjjhd.com 請教各位大神如何修改!
回覆內容:
我用nginx配置兩個站點,一個站點要配置成https訪問,一個是http來訪問?
server {
<code> listen 443; server_name www.gzjjhd.com; ssl on; ssl_certificate E:/webserver/nginx/sslkey/wosign.com.crt; ssl_certificate_key E:/webserver/nginx/sslkey/wosign.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; ssl_prefer_server_ciphers on; location / { root E:/www/jsd; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { root E:/www/jsd; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } server { listen 80; server_name app.gzjjhd.com; location / { root E:/www/HDWeb; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } include E:/www/HDWeb/rewrite.conf; location ~ \.php$ { root E:/www/HDWeb; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } </code>
我這樣配置完,app.gzjjhd.com 也變成 https://appgzjjhd.com 來訪問。但是我不要這樣。我要http://app.gzjjhd.com 請教各位大神如何修改!
分別用兩個站點設定檔
原來是我的443埠被佔用了
設定多個站點, 也就是虛擬主機的意思, 同一個server,載入多個站點, 在ngixn中設定虛擬主機,直接在主設定檔新增一個server{} 就可以了, 仿照他自帶的sever裡面的參數
<code>78 server { 79 listen 80; 80 # listen somename:8080; 81 server_name www.xuping.com; 82 root /usr/share/nginx/xuping; 83 index index.html index.htm; 84 85 location / { 86 try_files $uri $uri/ =404; 87 } 88 location ~ \.php$ { 89 fastcgi_split_path_info ^(.+\.php)(/.+)$; 90 # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini 91 92 # With php5-cgi alone: 93 # fastcgi_pass 127.0.0.1:9000; 94 # # With php5-fpm: 95 fastcgi_pass unix:/var/run/php5-fpm.sock; 96 fastcgi_index index.php; 97 include fastcgi_params; 98 } 99 </code>
100 # deny access to .htaccess files, if Apache's document root
101 # concurs with nginx's one
102 #
103 location ~ /.ht {
102 #
}

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

在php中,可以使用substr()函数来读取字符串后几个字符,只需要将该函数的第二个参数设置为负值,第三个参数省略即可;语法为“substr(字符串,-n)”,表示读取从字符串结尾处向前数第n个字符开始,直到字符串结尾的全部字符。

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

方法:1、用“str_replace(" ","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\ \;||\xc2\xa0)/","其他字符",$str)”语句。

查找方法:1、用strpos(),语法“strpos("字符串值","查找子串")+1”;2、用stripos(),语法“strpos("字符串值","查找子串")+1”。因为字符串是从0开始计数的,因此两个函数获取的位置需要进行加1处理。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

Dreamweaver CS6
視覺化網頁開發工具

WebStorm Mac版
好用的JavaScript開發工具