nginx配置示例

2021-10-09 17:30:19 字數 871 閱讀 9220

假設nginx使用9088埠的根路徑提供前端資源的訪問,tomcat使用9080埠的scf-pc路徑提供後端資源訪問。

1,修改local_mysql.properties

site=sit

eweb

site

=website=

sitewe

bsit

e=captcha.server=$/captcha

3,修改controller模組src/main/resources/config/auth-client.properties

auth.server.url=sit

eaut

h.cl

ient

.url

=auth.client.url=

siteau

th.c

lien

t.ur

l=auth.client.successurl=$/index/#/index

4,將controller模組install並部署到tomcat,執行tomcat。

5,將pc模組使用profile deploy_nginx進行install。

假設outputdirectory配置為/users/zhaoj/tmp/scf-pc/static,那麼前端資源會被發布到這個目錄。

6,在nginx中配置乙個server:

server

location /login

proxy_pass

}location /index/

7,開啟瀏覽器,訪問就可以進入登入頁面。

訪問這個位址時,前端資源由nginx從/users/zhaoj/tmp/scf-pc/static讀取,其他資源都會被**到

Nginx限制頻寬配置示例

示例一 複製 如下 示例二 複製 如下 location 表示限速100k每個客戶端只允許乙個執行緒 客戶端最終速度 rate conn,這樣就可以完美的實現限制頻寬的設定了。詳細的官方規則 示例三 在nginx.conf的http 新增 複製 如下 limit zone one binary re...

nginx配置檔案示例

這份配置檔案能解決什麼問題?1 php專案pathinfo模式的支援。pathinfo模式url比如 tpshop.com index.php home index。如果url沒有index.php,例如 tpshop.com home index index.html。配置檔案會重寫 rewrit...

nginx配置檔案示例

1 nginx作為靜態資源伺服器配置 location ceng location hehe 強調location 後的 順序不能反了 2 nginx作為反向 伺服器配置 location test proxy redirect引數說明 這個引數只在發生重定向時生效,前提 proxy redirec...