---
# System prepended metadata

title: Imperva
tags: [CDN]

---



## Imperva域名設定

### 設定所需網址
- 網址:https://management.service.imperva.com/
- 網址: https://admin.gandi.net/

### 零、Application & Add Website
- Add Website
進到頁面後會在home的頁面,要新增域名要按到上方的Application
    ![image](https://hackmd.io/_uploads/SJQ7fzJ50.png)


- Add Website
到Application的頁面後按Add Website
[![image](https://hackmd.io/_uploads/Sk6qzzycC.png)](https://hackmd.io/_uploads/Sk6qzzycC.png)

### 一、Add Website 填寫要設定的域名與CNAME
- Use SSL要打勾
- 在Web server IP/CNAME:	這邊填寫要CNAME的資訊(到AWS 負載平衡查看)
	```
	CNAME
	va-prod-go-netsource-lb-557826833.ap-southeast-1.elb.amazonaws.com
	```
- 填完後按Add Website
![1](https://hackmd.io/_uploads/SJrERtoUC.png)



### 二、Set Up HTTP
- 會回到新增域名的頁面,到要設定域名按驚嘆號底下會出現Set Up HTTP
- 按Set Up HTTP
![2](https://hackmd.io/_uploads/HkVjRYsUR.png)

![image](https://hackmd.io/_uploads/ry1voSk5C.png)


### 三、Configure SSL 
- 這邊按照原本預設無須多設定,直接按Continue
![3](https://hackmd.io/_uploads/HyJ-yqo8R.png)


### 四、Configure Yoor DNS Records
- 這邊會獲得要到Gandi設定的DNS資料,這邊要把DNS域名紀錄下來
![4](https://hackmd.io/_uploads/B12XJ9sLA.png)


### 五、Gandi設定CNAME與域名保護
- 網址: https://admin.gandi.net/
- 設定CNAME
- 將剛剛獲得的DNS資料到Gandi設定,域名最後要多加一個.
![5](https://hackmd.io/_uploads/S1wtkco8R.png)

---

- 域名保護設定這兩組IP到Gandi (廠商提供已設定無須再多設定)
![7imperva保護](https://hackmd.io/_uploads/HJFvxqsLA.png)


六、Check DNS
- 回到Imperva查看新增域名後面會出現驚嘆號資訊，點開後進行認證(CHECK DNS)
![6](https://hackmd.io/_uploads/Hyopk9sL0.png)



七、CDN域名快取設定
- 到要設定的域名裡面並且根據需求設定快取規則 (cdn.rockspeedline.net為例)
- Dashboards > Website Settings > CDN > Cache > Add Rule

![image](https://hackmd.io/_uploads/Sk-DFGJcA.png)

![cdn cache rule](https://hackmd.io/_uploads/rJi77qiI0.png)

![image](https://hackmd.io/_uploads/r1Tj6G1cR.png)

![image](https://hackmd.io/_uploads/S1DppfkcA.png)


---

### 補充:清理快取
- 到要清理快取的域名裡面(cdn.rockspeedline.net為例)
- Dashboards > CDN > Cache > Purge Cache > Purge Specific Resources
- 在URL裡面填入你要清除的網址
![image](https://hackmd.io/_uploads/HJxS0Mk90.png)

![purge cache](https://hackmd.io/_uploads/S1I-9csIC.png)





1.設定x-foeward-for
要跟廠商確認設定