Hi Ketan,
Thank you. I've tried this and get can seen quite different behaviour for the different browser versions:
Firefox 78 - There is a single request to "
https://my.gocd.server.com/go/admin/pipeline_group" which fails.
Firefox 60 - There are two requests. First to
http://my.gocd.server.com/go/admin/pipelines?fm=form-guid which gets a 301 redirect to the
https://my.gocd.server.com/go/admin/pipelines?fm=form-guid. The request to this second URL succeeds.
I've added the details of the requests and the Apache config files below. I have replaced the following parameters:
* URL
* JSESSIONID
* authenticity_token
* config_md5
* X-Request-Id
* guid of the form for `pipelines?fm=`
I'm grateful for any pointers. Many thanks for your help,
Andy
Firefox v78
=============
Curl
----
curl '
https://my.gocd.server.com/go/admin/pipeline_group'
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'
-H 'Accept: */*'
-H 'Accept-Language: en-GB,en;q=0.5' --compressed
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8'
-H 'X-Requested-With: XMLHttpRequest'
-H 'Origin:
https://my.gocd.server.com'
-H 'Connection: keep-alive'
-H 'Referer:
https://my.gocd.server.com/go/admin/pipelines'
-H 'Cookie: JSESSIONID=ff78-session-id.node0' --data-raw 'utf8=%E2%9C%93&authenticity_token=ff78-authenticity-token&config_md5=ff78-config_md5&group%5Bgroup%5D=ffgroupv78'
Request-Header
--------------
POST /go/admin/pipeline_group HTTP/1.1
Host:
my.gocd.server.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: */*
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 195
Origin:
https://my.gocd.server.comConnection: keep-alive
Referer:
https://my.gocd.server.com/go/admin/pipelinesCookie: JSESSIONID=ff78-session-id.node0
Response-Header
--------------
HTTP/1.1 422 Unprocessable Entity
Date: Tue, 14 Jul 2020 16:37:47 GMT
Server: Apache/2.4.29 (Ubuntu)
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: chrome=1
Content-Type: text/html;charset=utf-8
X-Request-Id: a-request-id-guid
X-Runtime: 0.092788
Content-Length: 1705
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
(Fails to create relevant pipeline group)
Firefox60
=========
Curl-1
----
curl "
http://my.gocd.server.com/go/admin/pipelines?fm=form-guid"
-H "Host:
my.gocd.server.com"
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
-H "Accept-Language: en-US,en;q=0.5" --compressed
-H "Cookie: JSESSIONID=ff60-session-id.node0"
-H "Connection: keep-alive"
-H "Upgrade-Insecure-Requests: 1"
Request-Header-1
--------------
Host:
my.gocd.server.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: JSESSIONID=ff60-session-id.node0
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Response-Header-1
--------------
Host:
my.gocd.server.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: JSESSIONID=ff60-session-id.node0
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Curl-2
----
curl "
https://my.gocd.server.com/go/admin/pipelines?fm=form-guid"
-H "Host:
my.gocd.server.com"
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
-H "Accept-Language: en-US,en;q=0.5" --compressed
-H "Cookie: JSESSIONID=ff60-session-id.node0"
-H "Connection: keep-alive"
-H "Upgrade-Insecure-Requests: 1"
Request-Header-2
--------------
Host:
my.gocd.server.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Cookie: JSESSIONID=ff60-session-id.node0
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Response-Header-2
--------------
HTTP/1.1 200 OK
Date: Tue, 14 Jul 2020 16:22:08 GMT
Server: Apache/2.4.29 (Ubuntu)
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: chrome=1
Content-Type: text/html;charset=utf-8
ETag: W/"37c71d34e8631cc8d5274afc4afa6783--gzip"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 8b1e22cb-70b6-480e-8341-839ab067a56d
X-Runtime: 0.586569
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
(Succeeds in creating the relevant pipeline group)
The relevant config files for Apache are below:
$ sudo more /etc/apache2/sites-enabled/*.conf
::::::::::::::
000-default.conf
::::::::::::::
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName
www.example.com ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
ServerName
my.gocd.server.comRewriteEngine on
# RewriteCond %{SERVER_NAME} =
my.gocd.server.com# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [R=permanent,L]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
::::::::::::::
000-default-le-ssl.conf
::::::::::::::
<IfModule mod_ssl.c>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName
www.example.com ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
# Proxy everything over to the GoCD server
ProxyPass /
http://localhost:8153/ ProxyPassReverse /
http://localhost:8153/ ProxyPreserveHost On
# RequestHeader set X-Forwarded-Proto "https"
<Location />
Order allow,deny
Allow from all
</Location>
SSLEngine on
ServerName
my.gocd.server.comSSLCertificateFile /etc/letsencrypt/live/
my.gocd.server.com/fullchain.pemSSLCertificateKeyFile /etc/letsencrypt/live/
my.gocd.server.com/privkey.pemInclude /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>