You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This instruction guides you in how to install PxWeb 2.0 on IIS.
3
+
This instruction guides you in how to install PxWeb 2 on IIS.
4
4
5
5
## Prerequisites
6
6
7
7
- A supported Windows server with IIS installed.
8
-
- ApiUrl to your PxWebapi2 installation.
8
+
- The [URL Rewrite module](https://www.iis.net/downloads/microsoft/url-rewrite) must be installed on your IIS.
9
+
- ApiUrl to your PxWebApi 2 installation.
9
10
If your tables endpoint is at `https://your.api.server/PxWeb/api/v2/tables`
10
11
then your ApiUrl is `https://your.api.server/PxWeb/api/v2` (omit a trailing slash, one is added automatically)
11
12
@@ -14,23 +15,53 @@ This instruction guides you in how to install PxWeb 2.0 on IIS.
14
15
1. Download the [zip file for the latest release](https://github.com/pxtools/PxWeb2/releases/latest) from GitHub.
15
16
It is found inside the Asserts heading.
16
17
Make sure to _Unblock_ it if its block by right clicking on it in _File Explorer_ and check the `Unblock` checkbox.
17
-
1. Put the contents of the zip file to the location of your choice. E.g `C:\inetpub\wwwroot\pxweb2`.
18
-
1. Adjust `baseApplicationPath` and `apiUrl` in `config\config.js`:
18
+
2. Put the contents of the zip file to the location of your choice. E.g `C:\inetpub\wwwroot\pxweb2`.
19
+
3. Adjust `baseApplicationPath` and `apiUrl` in `config\config.js`:
19
20
20
21
```js
21
22
baseApplicationPath:"/pxweb2/"
22
23
23
24
apiUrl:"your api url"
24
25
```
25
26
26
-
1. In `index.html`, adjust the `<base>` tag:
27
+
4. In `index.html`, adjust the `<base>` tag:
27
28
28
29
```html
29
30
<base href="/pxweb2/">
30
31
```
31
32
32
-
1.I didnt need this: Ensure the web server rewrites (if needed) static file requests correctly to that subpath.
33
+
5. In `web.config`, adjust the `Content-Security-Policy` to allow calls to your PxWebApi 2installation. Withinthe `Content-Security-Policy` replace the text `https://enter-your-api-domain-here`with the domain of your PxWebApi (for example https://api.scb.se):
33
34
34
-
1. In IIS find the folder and convert it to application. ( Concider using a separate Application pool for this :-) )
1. In IIS find the folder and convert it to an application. (Consider using a separate Application pool forthis)
35
40
36
41
1. Open "http(s)://"server adress"/pxweb2 .
42
+
43
+
## Troubleshooting
44
+
45
+
### Problem running PxWeb on localhost
46
+
47
+
If you are trying to run PxWeb directly on the server under localhost you might get an error looking like this in the console of your browser:
48
+
49
+
```
50
+
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
51
+
```
52
+
53
+
#### Solution
54
+
55
+
Change localhost in the URL to the computer name of the server.
56
+
57
+
### PxWeb refuses to connect to PxWebApi
58
+
59
+
If you get an error message looking like this in the console of your browser:
60
+
61
+
```
62
+
Refused to connect to 'https://your-api-url' because it violates the following Content Security Policy directive: "connect-src 'self' https://enter-your-api-domain-here".
63
+
```
64
+
65
+
#### Solution
66
+
67
+
You need to enter the domain of your PxWebApi in the Content Security Policy section in web.config, see step 5 of the installation steps above.
0 commit comments