鍍金池/ 問答/ Linux問答
不將就 回答

假設有 A,B,C,D 四臺服務器。A 是自己的機器;B 是跳板機;C,D 是線上機器,不能直接 ssh。

-A 有啥用?
你可以通過 ssh -o ProxyCommand='ssh user@B -p port -W %h:%p' user@C -p port 這樣一條命令登陸到 C。但是當你在 C 機器使用 ssh user@D 嘗試登陸 D 時,你會失敗。
但是你加上 -A 參數(shù)之后,就不會失?。?code>ssh -o ProxyCommand='ssh user@B -p port -W %h:%p' -A user@C -p port

所以:你可以認為 -A 將你的身份信息轉發(fā)了。 可以參考 ForwardAgent 配置。

-W 的話,就是轉發(fā) stdin, stdout 到目標機器上...

尤禮 回答

@RequestMapping(value = "login.do", method = RequestMethod.GET) 你這邊寫要求的是get請求啊

懶豬 回答

容器中安裝不了,可以容器外安裝啊,容器外弄好后自己封裝鏡像,然后拉進docker。

生性 回答

是不是你的git賬戶沒有修改權限,http://blog.csdn.net/yanzhenj...
可以按照這個配置你的git

絯孑氣 回答

使用react-router的createElement解決!
Router.js

......
...... // 省略其他無關緊要代碼

// 此處為要點擊刷新的組件
const arr = [
    home
];

// 開關優(yōu)化
let onOff =false;

// 頁面強制刷新,如果需要強制刷新在路由中添加onChange事件以及在組件數(shù)組添加
const createElement=(component, props) =>{
    if (props.children && onOff || props.children && arr.includes(props.routes.slice(-1)[0].getComponent)) {
        let children = Object.assign({}, props.children, {key : `${window.location.pathname}` + new Date().getTime()})
        props = { ...props, children };
        onOff = false;
    }
    return React.createElement(component, props)
}

const onChange = (props, next) => {
    onOff = true
    console.log(`${next.location.pathname}`, 'change');
}

const RouteConfig = (
    <Router history={history} createElement = {createElement}>
        <Route path="/home" getComponent={home} onChange = {onChange} />
        ...
        ...
    </Router>
);

export default RouteConfig;

如果您用的react-router4.0,當使用 component 時,router 將使用 React.createElement 根據(jù)給定的 component 創(chuàng)建一個新的 React 元素。這意味著如果你使用內(nèi)聯(lián)函數(shù)(inline function)傳值給 component將會產(chǎn)生不必要的重復裝載。對于內(nèi)聯(lián)渲染(inline rendering), 建議使用 renderprop。
也可以參考下我新寫的文章:這里有沒有你想要的react-router

慢半拍 回答

后端不要加成access-control-allow-origin為*,加成access-control-allow-origin:前端請求域名

離魂曲 回答

既然HTML inputnameimgs[],那curl也用這個就行了($data['imgs[]']=$file_obj),而不是搞個數(shù)組。

氕氘氚 回答

你用的webpack是哪個版本的,最新版的4.0出來了,把HtmlWebpackPlugin舍棄了,需要特別下載才行

$> yarn add html-webpack-plugin@webpack-contrib/html-webpack-plugin
舊酒館 回答

只要在本地測試成功,commit,push之后,鉤子自動同步到服務器,不能直接修改服務器上的文件,否則協(xié)同開發(fā)豈不是亂套了。

扯機薄 回答

我嘗試寫了一下,你看一下對不對

ip=$1
mask=$2
out=''
for index in {1..4}; do
    si=$(echo $ip | cut -d "." -f $index)
    sm=$(echo $mask | cut -d "." -f $index)
    if [ $index -ne 1 ]
    then
        out="$out."
    fi
    out="$out$[$si&$sm]"
done
echo $out
賤人曾 回答

原因是每次請求的sessionid 不同
后端跨域已經(jīng)配置好了
前端axios

// axios.js
axios.defaults.withCredentials=true;//讓ajax攜帶cookie

解決方案 :鏈接描述

苦妄 回答

既然題主的服務器在國外,首先判斷一下ip是否被墻,然后再看下是不是ssh的問題。建議題主把ping.pe, traceroute,和ssh的報錯都貼出來看看。

爛人 回答

分享一下:
npm中有個scope的東東,項目中會用到npm org和微軟的ts org(分別對應著不同的scope)。項目搭建的private registry對@types scope不支持;
至于0.12.7使用正常,完全是因為0.12.7版本下還沒有ts這個scope

解決方法:
RUN echo '@types:registry=https://registry.cnpmjs.org/' >> /root/.npmrc。
在npmrc中文件添加對@types scope的解析

朽鹿 回答
  1. upstream你可以當做負載均衡,比如你做了如下配置

    upstream app_weapp {
        server localhost:5757;
        server localhost:5758;
    }

    那么你收到的請求將會分流到這兩個應用,當然如果你是同一個應用部署到兩個服務器,比如

    upstream app_weapp {
        server 192.168.2.1:5757;
        server 192.168.2.2:5757;
    }

    那么你的流量就會被分流到這兩個服務器,和下面的proxy_pass是一起出現(xiàn)的,還有一些負載均衡的算法,具體可以看文檔: Using nginx as HTTP load balancer。

  2. 訪問http強制跳轉到https的確是rewrite在起作用,大概是你改完之后沒有重新加載配置:nginx -s reload
  3. 如果是靜態(tài)頁面,可以直接刪掉 location /...一整段的代碼,upstream也可以刪掉,然后整塊直接用root代替。如果一定要使用upsteam,那么你的靜態(tài)頁面必須部署在localhost:5757可以訪問到的地方

    • 解決方案1:直接拋棄upsteam,將資源掛載在https

      server {
          listen      443;
          server_name wx.ijason.cc;
          root root/myweb;
          ssl on;
      
          ssl_certificate           /data/release/nginx/1_wx.ijason.cc_bundle.crt;
          ssl_certificate_key       /data/release/nginx/2_wx.ijason.cc.key;
          ssl_session_timeout       5m;
          ssl_protocols             TLSv1 TLSv1.1 TLSv1.2;
          ssl_ciphers               ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
          ssl_session_cache         shared:SSL:50m;
          ssl_prefer_server_ciphers on;
          
      }
    • 解決方案2:保留upsteam,添加以下配置就好了,以下配置又增加了一個應用,可以通過localhost:5757訪問,配合上面的httpsupstream可以讓訪問https的流量被轉發(fā)到這里過來

      server {
          listen  5757;
          root root/myweb;
          index index.html;
      }
青檸 回答

你加載了C.php嗎?

require('C.php');
爛人 回答
docker rm $(docker ps -a | awk '/training\/webapp/ {print $1}')
墨小白 回答

你要裝啥?
express: npm install express