Skip to content

Commit b0864be

Browse files
committed
fix proxy
1 parent 72d203e commit b0864be

3 files changed

Lines changed: 31 additions & 27 deletions

File tree

proxy/nginx.conf

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
1-
server {
2-
listen 80;
3-
listen [::]:80 default ipv6only=on;
1+
events {}
42

5-
root /usr/share/nginx/html;
6-
index index.html;
3+
http {
4+
server {
5+
listen 80;
6+
listen [::]:80 default ipv6only=on;
77

8-
# timeouts
9-
proxy_send_timeout 3600;
10-
proxy_read_timeout 3600;
11-
fastcgi_send_timeout 3600;
12-
fastcgi_read_timeout 3600;
8+
root /usr/share/nginx/html;
9+
index index.html;
1310

14-
# file size
15-
client_max_body_size 150M;
11+
# timeouts
12+
proxy_send_timeout 3600;
13+
proxy_read_timeout 3600;
14+
fastcgi_send_timeout 3600;
15+
fastcgi_read_timeout 3600;
1616

17-
# all hostnames
18-
server_name _;
17+
# file size
18+
client_max_body_size 150M;
1919

20-
# Reverse proxies for the backend
21-
location /galahad/api/ {
22-
proxy_pass http://server:8010/;
23-
proxy_set_header X-Forwarded-Host localhost;
24-
proxy_set_header X-Forwarded-Proto http;
25-
}
20+
# all hostnames
21+
server_name _;
22+
23+
# Reverse proxies for the backend
24+
location /galahad/api/ {
25+
proxy_pass http://server:8010/;
26+
proxy_set_header X-Forwarded-Host localhost;
27+
proxy_set_header X-Forwarded-Proto http;
28+
}
2629

27-
# Reverse proxy for the frontend
28-
location / {
29-
proxy_pass http://client:8080/;
30+
# Reverse proxy for the frontend
31+
location / {
32+
proxy_pass http://client:8080/;
33+
}
3034
}
3135
}

server/src/main/kotlin/org/ivdnt/galahad/formats/folia/AaltoFoliaReader.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import org.ivdnt.galahad.annotations.Annotation
55
import org.ivdnt.galahad.annotations.AnnotationReader
66
import org.ivdnt.galahad.annotations.Layer
77
import org.ivdnt.galahad.annotations.Term
8+
import org.ivdnt.galahad.util.XmlUtil
89
import java.io.File
910
import javax.xml.stream.XMLInputFactory
1011
import javax.xml.stream.XMLStreamConstants
1112
import javax.xml.stream.XMLStreamReader
1213

1314
class AaltoFoliaReader(file: File,
1415
) : AnnotationReader(file) {
15-
private val factory: XMLInputFactory = InputFactoryImpl()
1616
private var pos: String = ""
1717
private var lemma: String = ""
1818
private var literal: String = ""
1919
private var ignoring: Boolean = false
2020

2121
override fun read(): Layer {
22-
val reader = factory.createXMLStreamReader(file.inputStream())
22+
val reader = XmlUtil.inputFactory.createXMLStreamReader(file.inputStream())
2323
parseTopLevelTextNodes(reader)
2424
return Layer(documents)
2525
}

server/src/main/kotlin/org/ivdnt/galahad/util/XmlUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.ivdnt.galahad.util
22

3+
import com.fasterxml.aalto.stax.InputFactoryImpl
34
import org.w3c.dom.Document
45
import org.w3c.dom.Element
56
import org.w3c.dom.Node
@@ -83,7 +84,6 @@ abstract class XmlUtil(
8384
setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "yes")
8485
}
8586
}
86-
87-
val inputFactory: XMLInputFactory by lazy { XMLInputFactory.newInstance() }
87+
val inputFactory: XMLInputFactory by lazy { InputFactoryImpl() }
8888
}
8989
}

0 commit comments

Comments
 (0)