I am quite new at this, but I have managed to get AnkiServer-2.0.6 running on a Raspberry Pi 3 & Ubuntu 16.04 on port 27701. I'm also running an Nginx server on port 80. Everything is on a local lan.
Syncing my clients works perfectly, but when trying to use the RESTful API, and I POST to my AnkiServer url, teamserver.lan:27701, I get 403 forbidden which leads me to believe my allowed hosts is not configured correctly. How do I set a port for allowed hosts in production.ini, or do I even need to?
jim@jimbook-ubuntu:~$ curl -v teamserver.lan
* Rebuilt URL to: teamserver.lan/
* Trying 192.168.2.70...
* Connected to teamserver.lan (192.168.2.70) port 80 (#0)
> GET / HTTP/1.1
> Host: teamserver.lan
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.10.0 (Ubuntu)
< Date: Mon, 22 Aug 2016 05:16:30 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Content-Type-Options: nosniff
< Vary: Accept-Encoding, Cookie
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Cache-Control: private, must-revalidate, max-age=0
< Last-Modified: Mon, 22 Aug 2016 05:16:30 GMT
<
* Connection #0 to host teamserver.lan left intact
jim@jimbook-ubuntu:~$ curl -v teamserver.lan:27701/sync
* Trying 192.168.2.70...
* Connected to teamserver.lan (192.168.2.70) port 27701 (#0)
> GET /sync HTTP/1.1
> Host: teamserver.lan:27701
> User-Agent: curl/7.47.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: PasteWSGIServer/0.5 Python/2.7.12
< Date: Mon, 22 Aug 2016 05:16:44 GMT
< Content-Type: text/plain; charset=UTF-8
< Content-Length: 16
<
* Closing connection 0
Anki Sync Serverjim@jimbook-ubuntu:~$ curl -v teamserver.lan:27701
* Rebuilt URL to: teamserver.lan:27701/
* Trying 192.168.2.70...
* Connected to teamserver.lan (192.168.2.70) port 27701 (#0)
> GET / HTTP/1.1
> Host: teamserver.lan:27701
> User-Agent: curl/7.47.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 403 Forbidden
< Server: PasteWSGIServer/0.5 Python/2.7.12
< Date: Mon, 22 Aug 2016 05:17:03 GMT
< Content-Length: 55
< Content-Type: text/plain; charset=UTF-8
<
403 Forbidden
Access was denied to this resource.
* Closing connection 0